fix(editor): submission note sent as typed, copies purged again after sign-out
This commit is contained in:
1 parent
6471b25812
commit
5e0aa625a8
4 files changed
+22
-3
No files matched your search
@@ -78,6 +78,22 @@ describe('SignOutButton', () => {
|
||||
expect(sessionStorage.getItem(copyKey(OTHER, 'v1'))).toBe('{}')
|
||||
})
|
||||
|
||||
it('purges again when a copy is written while the sign-out is in flight', async () => {
|
||||
sessionStorage.setItem(copyKey(user.id, 'v1'), '{}')
|
||||
signOut.mockImplementationOnce(async () => {
|
||||
sessionStorage.setItem(copyKey(user.id, 'v2'), '{}')
|
||||
})
|
||||
mount()
|
||||
await click()
|
||||
await userEvent.click(
|
||||
screen.getByRole('button', { name: fr['shell.sign_out_loss_confirm'] }),
|
||||
)
|
||||
await waitFor(() => expect(signOut).toHaveBeenCalledTimes(1))
|
||||
await waitFor(() =>
|
||||
expect(sessionStorage.getItem(copyKey(user.id, 'v2'))).toBeNull(),
|
||||
)
|
||||
})
|
||||
|
||||
it('ignores the copies of another account', async () => {
|
||||
sessionStorage.setItem(copyKey(OTHER, 'v1'), '{}')
|
||||
mount()
|
||||
|
||||
Reference in new issue
Block a user