Skip to content

Commit

Permalink
Fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
theseanything committed Aug 5, 2024
1 parent 3a302f6 commit 2513c21
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
30 changes: 19 additions & 11 deletions tests/cdn.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,26 @@ test.describe("CDN", () => {
expect(parseInt(response.headers()["x-cache-hits"])).toBeGreaterThan(0);
});

test("Check redirect from bare domain to www.gov.uk is working for HTTP", { tag: ["@production"] }, async ({ page }) => {
const response = await page.request.get("http://gov.uk", { maxRedirects: 0 });
expect(response.status()).toBe(301);
expect(response.headers()["location"]).toBe("https://gov.uk/");
});
test(
"Check redirect from bare domain to www.gov.uk is working for HTTP",
{ tag: ["@production"] },
async ({ page }) => {
const response = await page.request.get("http://gov.uk", { maxRedirects: 0 });
expect(response.status()).toBe(301);
expect(response.headers()["location"]).toBe("https://gov.uk/");
}
);

test("Check redirect from bare domain to www.gov.uk is working for HTTPS and has HSTS enabled", { tag: ["@production"] }, async ({ page }) => {
const response = await page.request.get("https://gov.uk", { maxRedirects: 0 });
expect(response.status()).toBe(301);
expect(response.headers()["location"]).toBe("https://www.gov.uk/");
expect(response.headers()["strict-transport-security"]).toBe("max-age=63072000; preload");
});
test(
"Check redirect from bare domain to www.gov.uk is working for HTTPS and has HSTS enabled",
{ tag: ["@production"] },
async ({ page }) => {
const response = await page.request.get("https://gov.uk", { maxRedirects: 0 });
expect(response.status()).toBe(301);
expect(response.headers()["location"]).toBe("https://www.gov.uk/");
expect(response.headers()["strict-transport-security"]).toBe("max-age=63072000; preload");
}
);

test("Check www.gov.uk redirect from HTTP to HTTPS is working", { tag: ["@production"] }, async ({ page }) => {
const response = await page.request.get("http://www.gov.uk", { maxRedirects: 0 });
Expand Down
2 changes: 1 addition & 1 deletion tests/data-gov-uk.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test.describe("Data.gov.uk", { tag: ["@app-dgu"] }, () => {
});
});

test.describe("CKAN", { tag: ["@app-dgu"] },() => {
test.describe("CKAN", { tag: ["@app-dgu"] }, () => {
test.use({ baseURL: publishingAppUrl("ckan") });

test("Check CKAN loads correctly", async ({ page }) => {
Expand Down

0 comments on commit 2513c21

Please sign in to comment.