fix(editor): a sign-out with a dirty dialog is said at the next sign-in

This commit is contained in:
bchanot committed 2026-11-14 18:50:42 +01:00
1 parent 7ecaf1998e
commit 28e298ac56
4 files changed
+178 -53

No files matched your search

@@ -621,7 +621,7 @@ describe('final review: leaving the editor with a dirty dialog (criterion 17)',
expect(screen.queryByText(notice)).toBeNull()
})
it('a sign-out leaves no flag under the tag it rotated', async () => {
it('a sign-out with a dirty dialog is said once to the same account, never to another', async () => {
const user = await mount()
await openFinding(user, /Node A/)
await modify(user)
@@ -631,10 +631,23 @@ describe('final review: leaving the editor with a dirty dialog (criterion 17)',
useAuthStore.setState({ user: null })
})
await waitFor(() => expect(findingDialog()).toBeNull())
const flags = Object.keys(sessionStorage).filter((k) =>
k.startsWith('faunosteo:editor:left-draft:'),
)
expect(flags).toEqual([])
const values = Object.keys(sessionStorage).map((k) => k + sessionStorage[k])
expect(values.join()).not.toContain('bis')
expect(values.join()).not.toContain(USER)
cleanup()
serverHas(sheetText(), 3)
mountDraft({ width: 1280, probe, user: 'user-2' })
await screen.findByRole('heading', {
level: 1,
name: 'Brouillon, version 4',
})
expect(screen.queryByText(notice)).toBeNull()
cleanup()
await mount()
expect(screen.getByText(notice)).toBeVisible()
cleanup()
await mount()
expect(screen.queryByText(notice)).toBeNull()
})
it('a clean dialog leaves no flag', async () => {