test(app): e2e cleanup checks the seeded name before archiving
D4 identity check: the integrity spec reads each own sheet's name by its captured id and archives it only when it is exactly the seeded name. seedGrant checks the account id as a captured id, now shared from records.ts.
This commit is contained in:
1 parent
1e5058577f
commit
3bea19f16b
4 files changed
+30
-16
No files matched your search
@@ -60,7 +60,7 @@ interface RunFixtures {
|
||||
}
|
||||
|
||||
let run: RunFixtures | null = null
|
||||
const ownSheets: string[] = []
|
||||
const ownSheets: { id: string; name: string }[] = []
|
||||
const ownGrants: { id: string; account: string }[] = []
|
||||
|
||||
const fixtures = (): RunFixtures => {
|
||||
@@ -74,13 +74,13 @@ test.beforeAll(async () => {
|
||||
test.setTimeout(120_000)
|
||||
const tag = randomUUID().slice(0, 8)
|
||||
const sound = await seedOfficialSheet(sameName(`R4 ${tag} saine`), 'listed')
|
||||
ownSheets.push(sound.id)
|
||||
ownSheets.push({ id: sound.id, name: sound.names.fr })
|
||||
const altered = await seedOfficialSheet(
|
||||
sameName(`R4 ${tag} altérée`),
|
||||
'listed',
|
||||
{ storedFingerprint: '0'.repeat(64) },
|
||||
)
|
||||
ownSheets.push(altered.id)
|
||||
ownSheets.push({ id: altered.id, name: altered.names.fr })
|
||||
const reader = await createAccount('fr', false)
|
||||
const grantId = await seedGrant(reader, 'catalog_reader')
|
||||
ownGrants.push({ id: grantId, account: reader.id })
|
||||
@@ -101,8 +101,10 @@ test.beforeAll(async () => {
|
||||
|
||||
test.afterAll(async () => {
|
||||
const failures: string[] = []
|
||||
for (const id of ownSheets.splice(0)) {
|
||||
const status = await archiveOwnSheet(id).catch((e: Error) => e.message)
|
||||
for (const { id, name } of ownSheets.splice(0)) {
|
||||
const status = await archiveOwnSheet(id, name).catch(
|
||||
(e: Error) => e.message,
|
||||
)
|
||||
if (status !== 'archived') failures.push(`sheet ${id}: ${status}`)
|
||||
}
|
||||
for (const grant of ownGrants.splice(0)) {
|
||||
|
||||
Reference in new issue
Block a user