Skip to content

Commit 9fec19c

Browse files
[manager] Update tests for new manager API
Updated tests for manager queue composable, server logs composable, and manager store to work with the new API signatures and functionality.
1 parent 5f9ad8e commit 9fec19c

File tree

3 files changed

+154
-246
lines changed

3 files changed

+154
-246
lines changed

tests-ui/tests/composables/useServerLogs.test.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,30 +24,32 @@ describe('useServerLogs', () => {
2424
})
2525

2626
it('should initialize with empty logs array', () => {
27-
const { logs } = useServerLogs()
27+
const { logs } = useServerLogs({ ui_id: 'test-ui-id' })
2828
expect(logs.value).toEqual([])
2929
})
3030

3131
it('should not subscribe to logs by default', () => {
32-
useServerLogs()
32+
useServerLogs({ ui_id: 'test-ui-id' })
3333
expect(api.subscribeLogs).not.toHaveBeenCalled()
3434
})
3535

3636
it('should subscribe to logs when immediate is true', () => {
37-
useServerLogs({ immediate: true })
37+
useServerLogs({ ui_id: 'test-ui-id', immediate: true })
3838
expect(api.subscribeLogs).toHaveBeenCalledWith(true)
3939
})
4040

4141
it('should start listening when startListening is called', async () => {
42-
const { startListening } = useServerLogs()
42+
const { startListening } = useServerLogs({ ui_id: 'test-ui-id' })
4343

4444
await startListening()
4545

4646
expect(api.subscribeLogs).toHaveBeenCalledWith(true)
4747
})
4848

4949
it('should stop listening when stopListening is called', async () => {
50-
const { startListening, stopListening } = useServerLogs()
50+
const { startListening, stopListening } = useServerLogs({
51+
ui_id: 'test-ui-id'
52+
})
5153

5254
await startListening()
5355
await stopListening()
@@ -56,7 +58,7 @@ describe('useServerLogs', () => {
5658
})
5759

5860
it('should register event listener when starting', async () => {
59-
const { startListening } = useServerLogs()
61+
const { startListening } = useServerLogs({ ui_id: 'test-ui-id' })
6062

6163
await startListening()
6264

@@ -68,7 +70,7 @@ describe('useServerLogs', () => {
6870
})
6971

7072
it('should handle log messages correctly', async () => {
71-
const { logs, startListening } = useServerLogs()
73+
const { logs, startListening } = useServerLogs({ ui_id: 'test-ui-id' })
7274

7375
await startListening()
7476

@@ -93,6 +95,7 @@ describe('useServerLogs', () => {
9395

9496
it('should use the message filter if provided', async () => {
9597
const { logs, startListening } = useServerLogs({
98+
ui_id: 'test-ui-id',
9699
messageFilter: (msg) => msg !== 'remove me'
97100
})
98101

0 commit comments

Comments
 (0)