Skip to content

create a test for updating non-first prv by fingerprint #3109

@tomholub

Description

@tomholub

The quite below is from a code review where the code was broken but tests didn't break, meaning this is a scenario we were not testing, and should be testing.

This uncovers a problem. The page should be able to update any key. As written, this will only be able to update the first key regardless of which key we want to update.

It appears we don't have a test for this, else the test should fail - we need to add a test for updating keys other then the first one. The test will be hard for you to write as it requires familiarity with OpenPGP, so we'll make another issue for that.

Before we add that test, you should make fingerprint a required parameter, which should fix the actual issue.

this.fingerprint = Assert.urlParamRequire.string(uncheckedUrlParams, 'fingerprint');

Then you grab key based on the fingerprint, not just the first one.

Further, whichever places call this must be updated to always add the fingerprint to the url.

Originally posted by @tomholub in #3086 (comment)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions