fix(tests): correct PbiStatusApi type and remove duplicate mock keys
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
adf6d3b36a
commit
1bc07ab47d
2 changed files with 3 additions and 5 deletions
|
|
@ -88,21 +88,21 @@ describe('GET /api/realtime/backlog', () => {
|
||||||
describe('shouldEmit scope filter (via backlog-store reducer)', () => {
|
describe('shouldEmit scope filter (via backlog-store reducer)', () => {
|
||||||
it('applyChange: pbi INSERT adds to pbis array', () => {
|
it('applyChange: pbi INSERT adds to pbis array', () => {
|
||||||
useBacklogStore.setState({ pbis: [], storiesByPbi: {}, tasksByStory: {} })
|
useBacklogStore.setState({ pbis: [], storiesByPbi: {}, tasksByStory: {} })
|
||||||
const pbi = { id: 'pbi-1', code: 'PBI-1', title: 'Test', priority: 2, created_at: new Date(), status: 'open' }
|
const pbi = { id: 'pbi-1', code: 'PBI-1', title: 'Test', priority: 2, created_at: new Date(), status: 'ready' as const }
|
||||||
useBacklogStore.getState().applyChange('pbi', 'I', pbi)
|
useBacklogStore.getState().applyChange('pbi', 'I', pbi)
|
||||||
expect(useBacklogStore.getState().pbis).toHaveLength(1)
|
expect(useBacklogStore.getState().pbis).toHaveLength(1)
|
||||||
expect(useBacklogStore.getState().pbis[0].id).toBe('pbi-1')
|
expect(useBacklogStore.getState().pbis[0].id).toBe('pbi-1')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('applyChange: pbi UPDATE patches existing pbi', () => {
|
it('applyChange: pbi UPDATE patches existing pbi', () => {
|
||||||
const pbi = { id: 'pbi-1', code: 'PBI-1', title: 'Old', priority: 2, created_at: new Date(), status: 'open' }
|
const pbi = { id: 'pbi-1', code: 'PBI-1', title: 'Old', priority: 2, created_at: new Date(), status: 'ready' as const }
|
||||||
useBacklogStore.setState({ pbis: [pbi], storiesByPbi: {}, tasksByStory: {} })
|
useBacklogStore.setState({ pbis: [pbi], storiesByPbi: {}, tasksByStory: {} })
|
||||||
useBacklogStore.getState().applyChange('pbi', 'U', { id: 'pbi-1', title: 'New' })
|
useBacklogStore.getState().applyChange('pbi', 'U', { id: 'pbi-1', title: 'New' })
|
||||||
expect(useBacklogStore.getState().pbis[0].title).toBe('New')
|
expect(useBacklogStore.getState().pbis[0].title).toBe('New')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('applyChange: pbi DELETE removes pbi', () => {
|
it('applyChange: pbi DELETE removes pbi', () => {
|
||||||
const pbi = { id: 'pbi-1', code: 'PBI-1', title: 'Test', priority: 2, created_at: new Date(), status: 'open' }
|
const pbi = { id: 'pbi-1', code: 'PBI-1', title: 'Test', priority: 2, created_at: new Date(), status: 'ready' as const }
|
||||||
useBacklogStore.setState({ pbis: [pbi], storiesByPbi: {}, tasksByStory: {} })
|
useBacklogStore.setState({ pbis: [pbi], storiesByPbi: {}, tasksByStory: {} })
|
||||||
useBacklogStore.getState().applyChange('pbi', 'D', { id: 'pbi-1' })
|
useBacklogStore.getState().applyChange('pbi', 'D', { id: 'pbi-1' })
|
||||||
expect(useBacklogStore.getState().pbis).toHaveLength(0)
|
expect(useBacklogStore.getState().pbis).toHaveLength(0)
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,6 @@ vi.mock('@dnd-kit/sortable', () => ({
|
||||||
}),
|
}),
|
||||||
verticalListSortingStrategy: {},
|
verticalListSortingStrategy: {},
|
||||||
rectSortingStrategy: {},
|
rectSortingStrategy: {},
|
||||||
arrayMove: (arr: unknown[]) => arr,
|
|
||||||
rectSortingStrategy: {},
|
|
||||||
sortableKeyboardCoordinates: {},
|
sortableKeyboardCoordinates: {},
|
||||||
arrayMove: (arr: unknown[]) => arr,
|
arrayMove: (arr: unknown[]) => arr,
|
||||||
}))
|
}))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue