Skip to content

Commit

Permalink
test: use WXDAI as reward token in tests as in fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
EresDev committed Dec 12, 2024
1 parent d06e7f6 commit 83b5641
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/unit/post-order.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import receiptTxForMockedParse from "../fixtures/post-order/receipt-tx-for-mocke
import receiptUusd from "../fixtures/post-order/receipt-tx-uusd.json";
import receiptGeneric from "../fixtures/post-order/receipt.json";
import { createEventContext, TESTS_BASE_URL } from "./shared-utils";
import * as constant from "../../shared/constants";

describe("Post order for a payment card", () => {
let server: SetupServerApi;
Expand All @@ -43,6 +44,8 @@ describe("Post order for a payment card", () => {
} catch (e) {
console.log(`Error starting msw server: ${e}`);
}
// Fixture use wxdai token for reward
constant.chainIdToRewardTokenMap[31337] = constant.Tokens.WXDAI;
});

beforeEach(async () => {
Expand Down Expand Up @@ -430,8 +433,9 @@ describe("Post order for a payment card", () => {
const eventCtx = createEventContext(request, execContext, true);
const response = await pagesFunction(eventCtx);
await waitOnExecutionContext(execContext);
expect(response.status).toBe(200);

expect(await response.json()).toEqual(orderCard13959);
expect(response.status).toBe(200);
});

it("should post order on sandbox", async () => {
Expand All @@ -451,8 +455,9 @@ describe("Post order for a payment card", () => {
const eventCtx = createEventContext(request, execContext, true);
const response = await pagesFunction(eventCtx);
await waitOnExecutionContext(execContext);
expect(response.status).toBe(200);

expect(await response.json()).toEqual(orderCard13959);
expect(response.status).toBe(200);
});
});

Expand Down

0 comments on commit 83b5641

Please sign in to comment.