Skip to content

Commit 5994ec1

Browse files
committed
add test for nested template
1 parent 12dfacc commit 5994ec1

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

test/generators/__snapshots__/template.test.ts.snap

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

3+
exports[`creates nested route templates 1`] = `
4+
"<template>{{yield}}</template>
5+
"
6+
`;
7+
38
exports[`generates a class-based \`.gjs\` template 1`] = `
49
"import Component from '@glimmer/component';
510

test/generators/template.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,13 @@ it("destroys a template", async (ctx) => {
8686

8787
ctx.expect(await pkg.pathExists("src/templates/foo.gjs")).to.equal(false);
8888
});
89+
90+
it("creates nested route templates", async (ctx) => {
91+
pkg = await Package.create("v2-addon");
92+
93+
await pkg.gember("template", "foo/bar/baz");
94+
95+
const content = await pkg.readFile("src/templates/foo/bar/baz.gjs");
96+
97+
ctx.expect(content).toMatchSnapshot();
98+
});

0 commit comments

Comments
 (0)