Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/community/src/server/passkey-challenge.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('the challenge held between the two passkey requests', () => {
const packed = packChallenge('authenticate', 'abc', {}, NOW)
const dot = packed.lastIndexOf('.')
const sig = packed.slice(dot + 1)
const tampered = `${packed.slice(0, dot + 1)}${sig.endsWith('A') ? 'B' : 'A'}${sig.slice(1)}`
const tampered = `${packed.slice(0, dot + 1)}${sig.startsWith('A') ? 'B' : 'A'}${sig.slice(1)}`
expect(unpackChallenge(tampered, 'authenticate', NOW)).toBeNull()
})
})
4 changes: 4 additions & 0 deletions docs/contributing/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ Most tests run without JavaScript. Test enhancements separately. Use the fixture

The suite shares state and runs serially. Restore global settings changed by a test. Use fixed clocks where appropriate and allow for task scheduling and the single-connection pool. Do not hide intermittent failures with retries.

Signature-tampering tests must change the character they inspect when choosing a
replacement. Comparing the last character and replacing the first can leave a
randomly generated signature unchanged.

Use the fake mailbox to retrieve mail tokens. Request-level tests should use the signed-header helper where HTTP/Secure-cookie behaviour differs from Chromium. Clear the intended cookie by name. Local passkey tests deliberately omit the board URL setting.

## Website tests
Expand Down
Loading