Skip to content

Commit d74f1c0

Browse files
fix: 🐛 fix errant trailing slash in url (#27)
1 parent af74892 commit d74f1c0

File tree

15 files changed

+58
-46
lines changed

15 files changed

+58
-46
lines changed

src/routes/+layout.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const trailingSlash = "never";

src/routes/about/+layout.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const trailingSlash = "never";

src/routes/classes/+layout.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const trailingSlash = "never";

src/routes/contact/+layout.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const trailingSlash = "never";

src/routes/gift-guide/+layout.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const trailingSlash = "never";

src/routes/payment/+layout.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const trailingSlash = "never";

src/routes/privacy-policy/+layout.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const trailingSlash = "never";

src/routes/repairs/+layout.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const trailingSlash = "never";

src/routes/shop/+layout.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const trailingSlash = "never";

src/routes/sitemap.xml/+layout.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const trailingSlash = "never";
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const trailingSlash = "never";

src/routes/useful-links/+layout.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const trailingSlash = "never";

tests/components/footer.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ test.describe("Footer", () => {
3131
);
3232

3333
await page.locator(".footer-icons >> nth=0").click();
34-
await page.waitForURL("http://localhost:4000/contact/");
35-
expect(page.url()).toBe("http://localhost:4000/contact/");
34+
await page.waitForURL("http://localhost:4000/contact");
35+
expect(page.url()).toBe("http://localhost:4000/contact");
3636
await page.locator("img.enki-logo").click();
3737
await page.waitForURL("http://localhost:4000/");
3838
expect(page.url()).toBe("http://localhost:4000/");

tests/components/header.spec.js

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -16,53 +16,53 @@ test.describe("Header", () => {
1616
await expect(page.locator("#nav-icon")).toHaveClass(/open/);
1717
await expect(page.locator("button>> nth=0")).toHaveText("shop");
1818
await page.locator("button>> nth=0").click();
19-
await page.waitForURL("http://localhost:4000/shop/");
20-
expect(page.url()).toBe("http://localhost:4000/shop/");
19+
await page.waitForURL("http://localhost:4000/shop");
20+
expect(page.url()).toBe("http://localhost:4000/shop");
2121
await page.locator("img.enki-logo").click();
2222
await page.waitForURL("http://localhost:4000/");
2323
expect(page.url()).toBe("http://localhost:4000/");
2424
await page.locator("#nav-icon").click();
2525

2626
await expect(page.locator("button>> nth=1")).toHaveText("gift guide");
2727
await page.locator("button>> nth=1").click();
28-
await page.waitForURL("http://localhost:4000/gift-guide/");
29-
expect(page.url()).toBe("http://localhost:4000/gift-guide/");
28+
await page.waitForURL("http://localhost:4000/gift-guide");
29+
expect(page.url()).toBe("http://localhost:4000/gift-guide");
3030
await page.locator("img.enki-logo").click();
3131
await page.waitForURL("http://localhost:4000/");
3232
expect(page.url()).toBe("http://localhost:4000/");
3333
await page.locator("#nav-icon").click();
3434

3535
await expect(page.locator("button>> nth=2")).toHaveText("repairs");
3636
await page.locator("button>> nth=2").click();
37-
await page.waitForURL("http://localhost:4000/repairs/");
38-
expect(page.url()).toBe("http://localhost:4000/repairs/");
37+
await page.waitForURL("http://localhost:4000/repairs");
38+
expect(page.url()).toBe("http://localhost:4000/repairs");
3939
await page.locator("img.enki-logo").click();
4040
await page.waitForURL("http://localhost:4000/");
4141
expect(page.url()).toBe("http://localhost:4000/");
4242
await page.locator("#nav-icon").click();
4343

4444
await expect(page.locator("button>> nth=3")).toHaveText("classes");
4545
await page.locator("button>> nth=3").click();
46-
await page.waitForURL("http://localhost:4000/classes/");
47-
expect(page.url()).toBe("http://localhost:4000/classes/");
46+
await page.waitForURL("http://localhost:4000/classes");
47+
expect(page.url()).toBe("http://localhost:4000/classes");
4848
await page.locator("img.enki-logo").click();
4949
await page.waitForURL("http://localhost:4000/");
5050
expect(page.url()).toBe("http://localhost:4000/");
5151
await page.locator("#nav-icon").click();
5252

5353
await expect(page.locator("button>> nth=4")).toHaveText("about");
5454
await page.locator("button>> nth=4").click();
55-
await page.waitForURL("http://localhost:4000/about/");
56-
expect(page.url()).toBe("http://localhost:4000/about/");
55+
await page.waitForURL("http://localhost:4000/about");
56+
expect(page.url()).toBe("http://localhost:4000/about");
5757
await page.locator("img.enki-logo").click();
5858
await page.waitForURL("http://localhost:4000/");
5959
expect(page.url()).toBe("http://localhost:4000/");
6060
await page.locator("#nav-icon").click();
6161

6262
await expect(page.locator("button>> nth=5")).toHaveText("contact");
6363
await page.locator("button>> nth=5").click();
64-
await page.waitForURL("http://localhost:4000/contact/");
65-
expect(page.url()).toBe("http://localhost:4000/contact/");
64+
await page.waitForURL("http://localhost:4000/contact");
65+
expect(page.url()).toBe("http://localhost:4000/contact");
6666
await page.locator("img.enki-logo").click();
6767
await page.waitForURL("http://localhost:4000/");
6868
expect(page.url()).toBe("http://localhost:4000/");
@@ -78,72 +78,72 @@ test.describe("Header", () => {
7878

7979
await expect(page.locator("a >> nth=0")).toHaveText("shop");
8080
await page.locator("a >> nth=0").click();
81-
await page.waitForURL("http://localhost:4000/shop/");
82-
expect(page.url()).toBe("http://localhost:4000/shop/");
81+
await page.waitForURL("http://localhost:4000/shop");
82+
expect(page.url()).toBe("http://localhost:4000/shop");
8383
await page.locator("img.enki-logo").click();
8484
await page.waitForURL("http://localhost:4000/");
8585
expect(page.url()).toBe("http://localhost:4000/");
8686

8787
await expect(page.locator("a >> nth=1")).toHaveText("gift guide");
8888
await page.locator("a >> nth=1").click();
89-
await page.waitForURL("http://localhost:4000/gift-guide/");
90-
expect(page.url()).toBe("http://localhost:4000/gift-guide/");
89+
await page.waitForURL("http://localhost:4000/gift-guide");
90+
expect(page.url()).toBe("http://localhost:4000/gift-guide");
9191
await page.locator("img.enki-logo").click();
9292
await page.waitForURL("http://localhost:4000/");
9393
expect(page.url()).toBe("http://localhost:4000/");
9494

9595
await expect(page.locator("a >> nth=2")).toHaveText("repairs");
9696
await page.locator("a >> nth=2").click();
97-
await page.waitForURL("http://localhost:4000/repairs/");
98-
expect(page.url()).toBe("http://localhost:4000/repairs/");
97+
await page.waitForURL("http://localhost:4000/repairs");
98+
expect(page.url()).toBe("http://localhost:4000/repairs");
9999
await page.locator("img.enki-logo").click();
100100
await page.waitForURL("http://localhost:4000/");
101101
expect(page.url()).toBe("http://localhost:4000/");
102102

103103
await expect(page.locator("a >> nth=3")).toHaveText("classes");
104104
await page.locator("a >> nth=3").click();
105-
await page.waitForURL("http://localhost:4000/classes/");
106-
expect(page.url()).toBe("http://localhost:4000/classes/");
105+
await page.waitForURL("http://localhost:4000/classes");
106+
expect(page.url()).toBe("http://localhost:4000/classes");
107107
await page.locator("img.enki-logo").click();
108108
await page.waitForURL("http://localhost:4000/");
109109
expect(page.url()).toBe("http://localhost:4000/");
110110

111111
await expect(page.locator("a >> nth=4")).toHaveText("about");
112112
await page.locator("a >> nth=4").click();
113-
await page.waitForURL("http://localhost:4000/about/");
114-
expect(page.url()).toBe("http://localhost:4000/about/");
113+
await page.waitForURL("http://localhost:4000/about");
114+
expect(page.url()).toBe("http://localhost:4000/about");
115115
await page.locator("img.enki-logo").click();
116116
await page.waitForURL("http://localhost:4000/");
117117
expect(page.url()).toBe("http://localhost:4000/");
118118

119119
await expect(page.locator("a >> nth=5")).toHaveText("contact");
120120
await page.locator("a >> nth=5").click();
121-
await page.waitForURL("http://localhost:4000/contact/");
122-
expect(page.url()).toBe("http://localhost:4000/contact/");
121+
await page.waitForURL("http://localhost:4000/contact");
122+
expect(page.url()).toBe("http://localhost:4000/contact");
123123
await page.locator("img.enki-logo").click();
124124
await page.waitForURL("http://localhost:4000/");
125125
expect(page.url()).toBe("http://localhost:4000/");
126126

127127
// this block clicks each of the links in the header without returning to the homepage
128128
// making sure they go to the correct place
129129
await page.locator("a >> nth=0").click();
130-
await page.waitForURL("http://localhost:4000/shop/");
131-
expect(page.url()).toBe("http://localhost:4000/shop/");
130+
await page.waitForURL("http://localhost:4000/shop");
131+
expect(page.url()).toBe("http://localhost:4000/shop");
132132
await page.locator("a >> nth=1").click();
133-
await page.waitForURL("http://localhost:4000/gift-guide/");
134-
expect(page.url()).toBe("http://localhost:4000/gift-guide/");
133+
await page.waitForURL("http://localhost:4000/gift-guide");
134+
expect(page.url()).toBe("http://localhost:4000/gift-guide");
135135
await page.locator("a >> nth=2").click();
136-
await page.waitForURL("http://localhost:4000/repairs/");
137-
expect(page.url()).toBe("http://localhost:4000/repairs/");
136+
await page.waitForURL("http://localhost:4000/repairs");
137+
expect(page.url()).toBe("http://localhost:4000/repairs");
138138
await page.locator("a >> nth=3").click();
139-
await page.waitForURL("http://localhost:4000/classes/");
140-
expect(page.url()).toBe("http://localhost:4000/classes/");
139+
await page.waitForURL("http://localhost:4000/classes");
140+
expect(page.url()).toBe("http://localhost:4000/classes");
141141
await page.locator("a >> nth=4").click();
142-
await page.waitForURL("http://localhost:4000/about/");
143-
expect(page.url()).toBe("http://localhost:4000/about/");
142+
await page.waitForURL("http://localhost:4000/about");
143+
expect(page.url()).toBe("http://localhost:4000/about");
144144
await page.locator("a >> nth=5").click();
145-
await page.waitForURL("http://localhost:4000/contact/");
146-
expect(page.url()).toBe("http://localhost:4000/contact/");
145+
await page.waitForURL("http://localhost:4000/contact");
146+
expect(page.url()).toBe("http://localhost:4000/contact");
147147
await page.locator("img.enki-logo").click();
148148
await page.waitForURL("http://localhost:4000/");
149149
expect(page.url()).toBe("http://localhost:4000/");

tests/routes/index.spec.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@ test.describe("Desktop Home Page", () => {
2424
await page.goto("/");
2525
await expect(page).toHaveScreenshot({ maxDiffPixelRatio: 0.15 });
2626
await page.locator("data-test-id=repairs").click();
27-
await page.waitForURL("http://localhost:4000/repairs/");
28-
expect(page.url()).toBe("http://localhost:4000/repairs/");
27+
await page.waitForURL("http://localhost:4000/repairs");
28+
expect(page.url()).toBe("http://localhost:4000/repairs");
2929
await page.goBack();
3030
expect(page.url()).toBe("http://localhost:4000/");
3131
await page.locator("data-test-id=classes").click();
32-
await page.waitForURL("http://localhost:4000/classes/");
33-
expect(page.url()).toBe("http://localhost:4000/classes/");
32+
await page.waitForURL("http://localhost:4000/classes");
33+
expect(page.url()).toBe("http://localhost:4000/classes");
3434
await page.goBack();
3535
expect(page.url()).toBe("http://localhost:4000/");
3636
await page.locator("data-test-id=online-shop").click();
37-
await page.waitForURL("http://localhost:4000/shop/");
38-
expect(page.url()).toBe("http://localhost:4000/shop/");
37+
await page.waitForURL("http://localhost:4000/shop");
38+
expect(page.url()).toBe("http://localhost:4000/shop");
3939
await page.goBack();
4040
expect(page.url()).toBe("http://localhost:4000/");
4141
await page.locator("data-test-id=guide").click();
42-
await page.waitForURL("http://localhost:4000/gift-guide/");
43-
expect(page.url()).toBe("http://localhost:4000/gift-guide/");
42+
await page.waitForURL("http://localhost:4000/gift-guide");
43+
expect(page.url()).toBe("http://localhost:4000/gift-guide");
4444
await page.goBack();
4545
expect(page.url()).toBe("http://localhost:4000/");
4646
});

0 commit comments

Comments
 (0)