Skip to content

Commit

Permalink
test: rename test file and solve a failed test case in it
Browse files Browse the repository at this point in the history
Rename `productsCategorieslist_get.test` test file to `settings_storeVariables_get.test`
because its response changed, And edit the only test case in the file to match the new
response from the endpoint.
  • Loading branch information
AbdulrhmanGoni committed Apr 6, 2024
1 parent 6ff251c commit 94b730d
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import SettingsModel from "../../../src/models/Settings.js"
import { fakeSettingsObject } from "../../fakes/fakeSettingsObject.js"
import { userRequest, closeTestingServer } from "../../helpers/testRequest.js"

beforeAll(async () => {
await SettingsModel.create(fakeSettingsObject)
})

afterAll(async () => {
await closeTestingServer()
})
Expand All @@ -11,9 +17,7 @@ describe("GET /api/settings/variables", () => {
it("Should returns an array of products categories", async () => {
const response = await userRequest(routePath, "get")
expect(response.statusCode).toBe(200)
expect(response.body.categoriesList).toEqual(
expect.arrayContaining([expect.any(String)])
)
expect(fakeSettingsObject).toMatchObject(response.body)
})

})

0 comments on commit 94b730d

Please sign in to comment.