Skip to content
Snippets Groups Projects
Commit 6c8601a8 authored by Zara Mudassar's avatar Zara Mudassar
Browse files

Test for GetUser api method

parent d1b8d17d
No related branches found
No related tags found
1 merge request!58Community home view
Pipeline #177717 failed
import {GetCommunity, GetListingsInCommunity} from "@/utils/apiutil";
import axios from "axios";
jest.mock("axios");
describe("testing mocking of apiutil.js", () => {
it("check that existing group returns correctly", async () => {
const expectedResponse = {
communityId: 4040,
name: "Fisken i vannet",
description: "For vi som liker fjell fisk",
visibility: 1,
location: "Bergen brygge",
picture: "fish blub blub"
};
axios.get.mockImplementation(() =>
Promise.resolve({ data: expectedResponse })
);
const communityResponse = await GetCommunity(4040);
expect(communityResponse.name).toBe(expectedResponse.name);
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment