Skip to content

Commit 48d387e

Browse files
committed
testing
1 parent 91df75a commit 48d387e

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

tests/unit/mobileWallet.test.ts

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
import { afterAll, expect, test, beforeEach, vi } from "vitest";
2-
import { SendRawEmailCommand, SESClient } from "@aws-sdk/client-ses";
3-
import { mockClient } from "aws-sdk-client-mock";
42
import { secretObject } from "./secret.testdata.js";
53
import init from "../../src/api/index.js";
64
import { describe } from "node:test";
75
import { EntraFetchError } from "../../src/common/errors/index.js";
8-
9-
const sesMock = mockClient(SESClient);
10-
const jwt_secret = secretObject["jwt_key"];
11-
vi.stubEnv("JwtSigningKey", jwt_secret);
6+
import { issueAppleWalletMembershipCard } from "../../src/api/functions/mobileWallet.js";
127

138
vi.mock("../../src/api/functions/membership.js", () => {
149
return {
@@ -72,21 +67,12 @@ describe("Mobile wallet pass issuance", async () => {
7267
await response.json();
7368
});
7469
test("Test that passes will be issued for members", async () => {
75-
sesMock.on(SendRawEmailCommand).resolves({});
7670
const response = await app.inject({
7771
method: "GET",
7872
url: "/api/v1/mobileWallet/[email protected]",
7973
});
8074
expect(response.statusCode).toBe(202);
81-
expect();
82-
});
83-
test("Test that SES errors result in a server error", async () => {
84-
sesMock.on(SendRawEmailCommand).rejects({});
85-
const response = await app.inject({
86-
method: "GET",
87-
url: "/api/v1/mobileWallet/[email protected]",
88-
});
89-
expect(response.statusCode).toBe(500);
75+
expect(issueAppleWalletMembershipCard).toHaveBeenCalledOnce();
9076
});
9177
afterAll(async () => {
9278
await app.close();

0 commit comments

Comments
 (0)