mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
feat(ocm-cli): workspace repo sync and manager token targeting (#233)
This commit is contained in:
1 parent
e12f319592
commit
a86e4b1238
69 files changed
+4858
-161
No files matched your search
@@ -0,0 +1,26 @@
|
||||
import { describe, it, expect, beforeEach } from 'vitest'
|
||||
import { useSendErrorStore } from './sendErrorStore'
|
||||
|
||||
describe('useSendErrorStore', () => {
|
||||
beforeEach(() => {
|
||||
useSendErrorStore.setState({ errors: {} })
|
||||
})
|
||||
|
||||
it('stores error keyed by sessionID', () => {
|
||||
const err = { sessionID: 'session-1', title: 'Error', message: 'Something failed' }
|
||||
useSendErrorStore.getState().setError(err)
|
||||
expect(useSendErrorStore.getState().getError('session-1')).toEqual(err)
|
||||
})
|
||||
|
||||
it('clears error only for the specified sessionID', () => {
|
||||
useSendErrorStore.getState().setError({ sessionID: 'session-1', title: 'Error', message: 'msg1' })
|
||||
useSendErrorStore.getState().setError({ sessionID: 'session-2', title: 'Error', message: 'msg2' })
|
||||
useSendErrorStore.getState().clearError('session-1')
|
||||
expect(useSendErrorStore.getState().getError('session-1')).toBeNull()
|
||||
expect(useSendErrorStore.getState().getError('session-2')).not.toBeNull()
|
||||
})
|
||||
|
||||
it('returns null when no error exists for sessionID', () => {
|
||||
expect(useSendErrorStore.getState().getError('nonexistent')).toBeNull()
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user