Skip to content

Commit b3b9073

Browse files
Michał Fąferekmfaferek93
authored andcommitted
test: add PREFAILED status mapping test
1 parent 6027d36 commit b3b9073

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/lib/sovd-api.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,16 @@ describe('SovdApiClient', () => {
119119
expect(result.items[0]?.status).toBe('healed');
120120
});
121121

122+
it('maps PREFAILED API status to pending', async () => {
123+
vi.mocked(fetch).mockResolvedValue({
124+
ok: true,
125+
json: () => Promise.resolve({ items: [makeFaultItem({ status: 'PREFAILED' })] }),
126+
} as Response);
127+
128+
const result = await client.listAllFaults('all');
129+
expect(result.items[0]?.status).toBe('pending');
130+
});
131+
122132
it('maps CONFIRMED API status to active', async () => {
123133
vi.mocked(fetch).mockResolvedValue({
124134
ok: true,

0 commit comments

Comments
 (0)