Skip to content

Commit 86114a7

Browse files
committed
fix(tests): put ok in mocked fetch fn
1 parent 540f23f commit 86114a7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apps/frontend/__tests__/question.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ describe("GetSingleQuestion", () => {
210210
const DOCREF = "mockdocref";
211211
beforeEach(() => {
212212
global.fetch = jest.fn().mockResolvedValue({
213-
ok: true, // // Ensure `ok` is true to hit the success branch
213+
ok: true, // Ensure `ok` is true to hit the success branch
214214
async json() {
215215
return QUESTIONS[0]
216216
},
@@ -240,6 +240,7 @@ describe("CreateQuestion", () => {
240240
global.fetch = jest.fn().mockResolvedValue({
241241
status: 200,
242242
statusText: "OK",
243+
ok: true, // Ensure `ok` is true to hit the success branch
243244
async json() {
244245
return createdQuestion
245246
}

0 commit comments

Comments
 (0)