fix(frontend): clean test validation output

This commit is contained in:
Sanaei
2026-08-12 15:35:20 +02:00
parent 1c255fc00c
commit 1f846c3cb2
9 changed files with 64 additions and 13 deletions
+3
View File
@@ -35,6 +35,7 @@ const envelope = (data: unknown): HttpResponse => ({ ok: true, status: 200, stat
describe('HttpUtil', () => {
beforeEach(() => {
vi.clearAllMocks();
vi.spyOn(console, 'error').mockImplementation(() => undefined);
});
it('unwraps a success envelope and shows a success toast', async () => {
@@ -80,6 +81,7 @@ describe('HttpUtil', () => {
expect(msg.success).toBe(false);
expect(msg.msg).toBe('bad input');
expect(console.error).not.toHaveBeenCalled();
});
it('maps a thrown native error to a failure Msg via its message', async () => {
@@ -88,6 +90,7 @@ describe('HttpUtil', () => {
const msg = await HttpUtil.get('/x', undefined, { silent: true });
expect(msg.msg).toBe('Network down');
expect(console.error).not.toHaveBeenCalled();
});
it('returns "No response data" for an empty body', async () => {