Skip to content

Commit 05b25e5

Browse files
committed
fix cfn and live test
1 parent 363a9af commit 05b25e5

File tree

2 files changed

+27
-12
lines changed

2 files changed

+27
-12
lines changed

cloudformation/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ Resources:
853853
OriginCustomHeaders:
854854
- HeaderName: X-Origin-Verify
855855
HeaderValue: !Join ['-', ['secret', !Select [4, !Split ['-', !Select [2, !Split ['/', !Ref AWS::StackId]]]]]]
856-
- Id: ACMRootOrigi
856+
- Id: ACMRootOrigin
857857
DomainName: !Select [0, !Split ['/', !Select [1, !Split ['https://', !GetAtt AppLambdaUrl.FunctionUrl]]]]
858858
OriginPath: "/api/v1/ical/ACM"
859859
CustomOriginConfig:

tests/live/ical.test.ts

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,29 @@ describe(
4747
},
4848
);
4949

50-
test("Check that the ical base works", { timeout: 45000 }, async () => {
51-
const response = await fetchWithRateLimit(
52-
`${baseEndpoint.replace("core", "ical")}/ACM`,
53-
);
54-
expect(response.status).toBe(200);
55-
expect(response.headers.get("Content-Disposition")).toEqual(
56-
'attachment; filename="calendar.ics"',
57-
);
58-
const calendar = ical.sync.parseICS(await response.text());
59-
expect(calendar["vcalendar"]["type"]).toEqual("VCALENDAR");
60-
});
50+
test(
51+
"Check that the ical base works and uses a default host of ACM",
52+
{ timeout: 45000 },
53+
async () => {
54+
const response = await fetchWithRateLimit(
55+
`${baseEndpoint.replace("core", "ical")}/ACM`,
56+
);
57+
const responseBase = await fetchWithRateLimit(
58+
`${baseEndpoint.replace("core", "ical")}`,
59+
);
60+
expect(response.status).toBe(200);
61+
expect(responseBase.status).toBe(200);
62+
expect(response.headers.get("Content-Disposition")).toEqual(
63+
'attachment; filename="calendar.ics"',
64+
);
65+
expect(responseBase.headers.get("Content-Disposition")).toEqual(
66+
'attachment; filename="calendar.ics"',
67+
);
68+
const text1 = await response.text();
69+
const text2 = await responseBase.text();
70+
expect(text1).toStrictEqual(text2);
71+
72+
const calendar = ical.sync.parseICS(text1);
73+
expect(calendar["vcalendar"]["type"]).toEqual("VCALENDAR");
74+
},
75+
);

0 commit comments

Comments
 (0)