mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-21 07:14:11 +00:00
test: remove redundant mock restoration calls
vi.restoreAllMocks() in afterEach already handles cleanup
This commit is contained in:
@@ -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()
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user