Skip to content

Commit

Permalink
fixing test
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinSchuhmacher committed Feb 21, 2025
1 parent 9162455 commit 3941125
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/store/accounts.unit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,29 @@ describe("accounts module", () => {
describe("actions", () => {
beforeEach(() => {
initializeAxios({
get: async (path: string) => {
requestPath = path;
return { data: { ttl: 100 } };
},
post: async (path: string) => {
requestPath = path;
},
} as AxiosInstance);
});

it("getTTL action should make a post request to the right path", async () => {
it("getTTL action should make a get request to the right path", async () => {
const accountsModule = new AccountsModule({});

expect(requestPath).toBe("");
await accountsModule.getTTL();
expect(requestPath).toBe(URL);
});
it("getTTL action should return a number", async () => {
const accountsModule = new AccountsModule({});

const response = await accountsModule.getTTL();
expect(response).toBe(100);
});
it("getTTL should call resetBusinessError and setStatus mutations", async () => {
const accountsModule = new AccountsModule({});
const spyResetError = jest.fn();
Expand Down

0 comments on commit 3941125

Please sign in to comment.