deleted one test file

This commit is contained in:
Philip Cheung 2024-10-07 11:27:27 +08:00
parent e519415e94
commit 152404d681
1 changed files with 0 additions and 40 deletions

View File

@ -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' })
})
})