Skip to content

Commit 8726aaa

Browse files
committed
add e2e
1 parent 38a81cb commit 8726aaa

File tree

5 files changed

+25
-3
lines changed

5 files changed

+25
-3
lines changed

examples/playground15/app/api/signal/revalidate/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { revalidatePath } from "next/cache";
33
export const dynamic = "force-dynamic";
44

55
export async function GET() {
6-
revalidatePath("/signal");
6+
revalidatePath("/signal/");
77

88
return new Response("ok");
99
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Image from "next/image";
2+
3+
import tomineImg from "../../public/tomine.webp";
4+
5+
export default function Page() {
6+
return (
7+
<div>
8+
<Image src={tomineImg} alt="Picture of Tomine" />
9+
</div>
10+
);
11+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { test, expect } from "@playwright/test";
2+
3+
test.describe("next/image with trailing slash", () => {
4+
test("next/image with trailing slash", async ({ page }) => {
5+
await page.goto("/image");
6+
await expect(page.getByAltText("Picture of Tomine")).toBeVisible();
7+
// The trailing slash should only be there if trailingSlash is enabled in next.config.ts
8+
expect(await page.getAttribute("img", "src")).toMatch(/^\/_next\/image\//);
9+
});
10+
});
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
import { initOpenNextCloudflareForDev, getDeploymentId } from "@opennextjs/cloudflare";
2+
import { NextConfig } from "next";
23

34
initOpenNextCloudflareForDev();
45

5-
/** @type {import('next').NextConfig} */
6-
const nextConfig = {
6+
const nextConfig: NextConfig = {
77
typescript: { ignoreBuildErrors: true },
88
eslint: { ignoreDuringBuilds: true },
99
experimental: {
1010
// Generate source map to validate the fix for opennextjs/opennextjs-cloudflare#341
1111
serverSourceMaps: true,
1212
},
1313
deploymentId: getDeploymentId(),
14+
trailingSlash: true,
1415
};
1516

1617
export default nextConfig;
8.43 KB
Loading

0 commit comments

Comments
 (0)