Skip to content

Commit 1fa94bd

Browse files
test: cover sign store mounted state
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent fd55d3c commit 1fa94bd

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

src/tests/store/sign.spec.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,28 @@ describe('useSignStore', () => {
223223
})
224224
})
225225

226+
describe('mounted state', () => {
227+
it('marks the sign interface as ready when a file is selected for signing', () => {
228+
const store = useSignStore()
229+
230+
expect(store.mounted).toBe(false)
231+
232+
store.setFileToSign(createDocument())
233+
234+
expect(store.mounted).toBe(true)
235+
})
236+
237+
it('clears the mounted state when resetting the sign store', () => {
238+
const store = useSignStore()
239+
240+
store.setFileToSign(createDocument())
241+
store.reset()
242+
243+
expect(store.mounted).toBe(false)
244+
expect(store.document).toBeUndefined()
245+
})
246+
})
247+
226248
describe('buildSignUrl', () => {
227249
it('uses /sign/uuid endpoint when signRequestUuid is provided', () => {
228250
const store = useSignStore()

0 commit comments

Comments
 (0)