test: remove redundant mock restoration calls

vi.restoreAllMocks() in afterEach already handles cleanup
This commit is contained in:
bymyself
2026-01-15 23:20:28 -08:00
parent add7a4fbd4
commit fdba5d270f

View File

@@ -59,25 +59,21 @@ describe('workflowSessionStorageService', () => {
})
it('returns false after max eviction attempts', () => {
const spy = vi.spyOn(sessionStorage, 'setItem').mockImplementation(() => {
vi.spyOn(sessionStorage, 'setItem').mockImplementation(() => {
throw new DOMException('Quota exceeded', 'QuotaExceededError')
})
const result = setWithEviction('key', { test: 'data' })
expect(result).toBe(false)
spy.mockRestore()
})
it('returns false on unexpected errors', () => {
const spy = vi.spyOn(sessionStorage, 'setItem').mockImplementation(() => {
vi.spyOn(sessionStorage, 'setItem').mockImplementation(() => {
throw new Error('Unexpected error')
})
const result = setWithEviction('key', { test: 'data' })
expect(result).toBe(false)
spy.mockRestore()
})
})