Skip to content

Commit 856bfbd

Browse files
committed
add live tests for external members
1 parent 8601b50 commit 856bfbd

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

tests/live/membership.test.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,46 @@ describe("Membership API basic checks", async () => {
5656
expect(response.status).toBe(400);
5757
expect(response.headers.get("x-acm-data-source")).toBeNull();
5858
});
59+
test(
60+
"Test that getting external non-members succeeds",
61+
{ timeout: 3000 },
62+
async () => {
63+
const response = await fetch(
64+
`${baseEndpoint}/api/v1/membership/zzzz?list=built`,
65+
{
66+
method: "GET",
67+
},
68+
);
69+
70+
expect(response.status).toBe(200);
71+
72+
const responseBody = await response.json();
73+
expect(responseBody).toStrictEqual({
74+
netId: "zzzz",
75+
list: "built",
76+
isPaidMember: false,
77+
});
78+
},
79+
);
80+
test(
81+
"Test that getting external members succeeds",
82+
{ timeout: 3000 },
83+
async () => {
84+
const response = await fetch(
85+
`${baseEndpoint}/api/v1/membership/zzzz?list=acmtesting`,
86+
{
87+
method: "GET",
88+
},
89+
);
90+
91+
expect(response.status).toBe(200);
92+
93+
const responseBody = await response.json();
94+
expect(responseBody).toStrictEqual({
95+
netId: "zzzz",
96+
list: "acmtesting",
97+
isPaidMember: true,
98+
});
99+
},
100+
);
59101
});

0 commit comments

Comments
 (0)