|
18 | 18 |
|
19 | 19 | import '@testing-library/jest-dom/vitest'; |
20 | 20 |
|
21 | | -import type { PodContainerInfo, PodInfo } from '@podman-desktop/api'; |
| 21 | +import type { PodContainerInfo } from '@podman-desktop/api'; |
22 | 22 | import { beforeEach, expect, test } from 'vitest'; |
23 | 23 |
|
24 | 24 | import { TerminalService } from '/@/lib/kube/pods/terminal/KubernetesTerminalService'; |
| 25 | +import type { PodInfoUI } from '/@/lib/pod/PodInfoUI'; |
25 | 26 |
|
26 | 27 | let terminalService: TestableKubernetesTerminalService; |
27 | 28 |
|
28 | 29 | class TestableKubernetesTerminalService extends TerminalService { |
29 | | - public testInvalidateCacheRecordOnStatusUpdate(podsInfos: PodInfo[]): void { |
| 30 | + public testInvalidateCacheRecordOnStatusUpdate(podsInfos: PodInfoUI[]): void { |
30 | 31 | return this.invalidateCacheRecordOnStatusUpdate(podsInfos); |
31 | 32 | } |
32 | 33 |
|
33 | 34 | public testToKey(podName: string, containerName: string): string { |
34 | 35 | return super.toKey(podName, containerName); |
35 | 36 | } |
36 | 37 |
|
37 | | - public testInvalidateCacheRecordOnPodRemove(podsInfos: PodInfo[]): void { |
| 38 | + public testInvalidateCacheRecordOnPodRemove(podsInfos: PodInfoUI[]): void { |
38 | 39 | return this.invalidateCacheRecordOnPodRemove(podsInfos); |
39 | 40 | } |
40 | 41 |
|
@@ -69,11 +70,11 @@ test('should check if the terminal exists in the cache', () => { |
69 | 70 |
|
70 | 71 | test('should invalidate cache for non-running containers', () => { |
71 | 72 | terminalService.testTerminalCache().set('pod1-container1', {}); |
72 | | - const podsInfosMock: PodInfo[] = [ |
| 73 | + const podsInfosMock: PodInfoUI[] = [ |
73 | 74 | { |
74 | | - Name: 'pod1', |
75 | | - Containers: [{ Names: 'container1', Status: 'exited' } as PodContainerInfo], |
76 | | - } as PodInfo, |
| 75 | + name: 'pod1', |
| 76 | + containers: [{ Names: 'container1', Status: 'exited' } as PodContainerInfo], |
| 77 | + } as PodInfoUI, |
77 | 78 | ]; |
78 | 79 |
|
79 | 80 | terminalService.testInvalidateCacheRecordOnStatusUpdate(podsInfosMock); |
|
0 commit comments