14 lines
738 B
JavaScript
14 lines
738 B
JavaScript
import test from 'node:test'
|
|||
|
|
import assert from 'node:assert/strict'
|
||
|
|
import { readFile } from 'node:fs/promises'
|
||
|
|
|
||
|
|
const source = await readFile(new URL('./client-test-env-acceptance.mjs', import.meta.url), 'utf8')
|
||
|
|
|
||
|
|
test('client registration distinguishes incomplete-registration replay from credential conflicts', () => {
|
||
|
|
assert.match(source, /same credentials replay the incomplete registration/)
|
||
|
|
assert.match(source, /\['accountId', 'tenantId', 'membershipId'\]/)
|
||
|
|
assert.match(source, /String\(json\.data\[field\]\), String\(registration\.json\.data\[field\]\)/)
|
||
|
|
assert.match(source, /duplicate username with different credentials is rejected/)
|
||
|
|
assert.match(source, /body: \{ \.\.\.registrationBody, password: `Different/)
|
||
|
|
})
|