feat: add support for route groups (#1563)

This commit is contained in:
Marvin Hagemeister
2023-08-02 09:51:20 +02:00
committed by GitHub
parent 4b28e2e269
commit e4d797ae4e
17 changed files with 384 additions and 218 deletions
+32
View File
@@ -0,0 +1,32 @@
import { assertTextMany, fetchHtml, withFresh } from "./test_utils.ts";
Deno.test("applies only _layout file of one group", async () => {
await withFresh(
"./tests/fixture/main.ts",
async (address) => {
const doc = await fetchHtml(`${address}/route-groups`);
assertTextMany(doc, "p", ["Foo layout", "Foo page"]);
},
);
});
Deno.test("applies only _layout files in parent groups", async () => {
await withFresh(
"./tests/fixture/main.ts",
async (address) => {
const doc = await fetchHtml(`${address}/route-groups/baz`);
assertTextMany(doc, "p", ["Bar layout", "Baz layout", "Baz page"]);
},
);
});
Deno.test("applies only _layout files in parent groups #2", async () => {
await withFresh(
"./tests/fixture/main.ts",
async (address) => {
const doc = await fetchHtml(`${address}/route-groups/boof`);
assertTextMany(doc, "p", ["Bar layout", "Boof Page"]);
},
);
});