From 152404d681ac7bba8838392ee135889a8294b8d5 Mon Sep 17 00:00:00 2001 From: Philip Cheung Date: Mon, 7 Oct 2024 11:27:27 +0800 Subject: [PATCH] deleted one test file --- frontend/tests/AboutUsService.spec.ts | 40 --------------------------- 1 file changed, 40 deletions(-) delete mode 100644 frontend/tests/AboutUsService.spec.ts diff --git a/frontend/tests/AboutUsService.spec.ts b/frontend/tests/AboutUsService.spec.ts deleted file mode 100644 index add38bd..0000000 --- a/frontend/tests/AboutUsService.spec.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { AboutUsService } from "../client/services" -import { aboutUsResponse, aboutUsData } from "../utils/user" - -describe('AboutUsService', () => { - it('should fetch AboutUs data', async () => { - jest.spyOn(global, 'fetch').mockResolvedValue({ - json: jest.fn().mockResolvedValue(aboutUsResponse), - } as Response) - - const response = await AboutUsService.getAbouts() - expect(response).toEqual(aboutUsData) - }) - - it('should create a new AboutUs', async () => { - jest.spyOn(global, 'fetch').mockResolvedValue({ - json: jest.fn().mockResolvedValue({ id: '1' }), - } as Response) - - const response = await AboutUsService.createAboutUs(aboutUsData[0]) - expect(response).toEqual({ id: '1' }) - }) - - it('should update an AboutUs', async () => { - jest.spyOn(global, 'fetch').mockResolvedValue({ - json: jest.fn().mockResolvedValue({ id: '1' }), - } as Response) - - const response = await AboutUsService.updateAboutUs(aboutUsData[0].id, aboutUsData[0]) - expect(response).toEqual({ id: '1' }) - }) - - it('should delete an AboutUs', async () => { - jest.spyOn(global, 'fetch').mockResolvedValue({ - json: jest.fn().mockResolvedValue({ id: '1' }), - } as Response) - - const response = await AboutUsService.deleteAboutUs({ id: '1' } as any) - expect(response).toEqual({ id: '1' }) - }) -}) \ No newline at end of file