Skip to content

Commit

Permalink
add deletion test
Browse files Browse the repository at this point in the history
  • Loading branch information
adrastaea committed Nov 27, 2024
1 parent 35ff923 commit 394c4a9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/backend/src/nest/auth/sigchain.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ describe('SigChainManager', () => {
expect(loadedSigChain).toBeDefined()
expect(sigChainManager.getActiveChain()).toBe(loadedSigChain)
})
it('should delete sigchains from disk', async () => {
await sigChainManager.deleteChain('test3', true)
expect(() => sigChainManager.getChain('test3')).toThrowError()
await expect(sigChainManager.loadChain('test3', true)).rejects.toThrowError()
})
it('should not allow duplicate chains to be added', async () => {
await sigChainManager.createChain('test4', 'user4', false)
await expect(sigChainManager.createChain('test4', 'user4', false)).rejects.toThrowError()
Expand Down

0 comments on commit 394c4a9

Please sign in to comment.