Skip to content

Commit 48bf2e7

Browse files
committed
Add test for 192
1 parent 48b14e6 commit 48bf2e7

4 files changed

Lines changed: 122 additions & 0 deletions

File tree

tests/cases/gts/rendering-test.gts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,36 @@ module('Render with template tag', function (hooks) {
1111
</template>);
1212
assert.dom().hasText('what');
1313
});
14+
15+
16+
test('it has a template tag with a tag', async function (assert) {
17+
await render(<template>
18+
<h1>what</h1>
19+
</template>);
20+
assert.dom().hasText('what');
21+
});
22+
23+
24+
test('it has a template tag with a block', async function (assert) {
25+
await render(<template>
26+
{{#if true}}
27+
what
28+
{{/if}}
29+
</template>);
30+
assert.dom().hasText('what');
31+
});
32+
33+
test('it has a template tag with a one-line block', async function (assert) {
34+
await render(<template>
35+
{{#if true}}what{{/if}}
36+
</template>);
37+
assert.dom().hasText('what');
38+
});
39+
40+
test('it has a template tag with a one-line block', async function (assert) {
41+
await render(<template>
42+
{{if true 'what'}}
43+
</template>);
44+
assert.dom().hasText('what');
45+
});
1446
});

tests/unit-tests/__snapshots__/format.test.ts.snap

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,36 @@ module("Render with template tag", function (hooks) {
789789
await render(<template>what</template>);
790790
assert.dom().hasText("what");
791791
});
792+
793+
test("it has a template tag with a tag", async function (assert) {
794+
await render(
795+
<template>
796+
<h1>what</h1>
797+
</template>,
798+
);
799+
assert.dom().hasText("what");
800+
});
801+
802+
test("it has a template tag with a block", async function (assert) {
803+
await render(
804+
<template>
805+
{{#if true}}
806+
what
807+
{{/if}}
808+
</template>,
809+
);
810+
assert.dom().hasText("what");
811+
});
812+
813+
test("it has a template tag with a one-line block", async function (assert) {
814+
await render(<template>{{#if true}}what{{/if}}</template>);
815+
assert.dom().hasText("what");
816+
});
817+
818+
test("it has a template tag with a one-line block", async function (assert) {
819+
await render(<template>{{if true "what"}}</template>);
820+
assert.dom().hasText("what");
821+
});
792822
});
793823
"
794824
`;

tests/unit-tests/config/__snapshots__/semi-false.test.ts.snap

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,36 @@ module("Render with template tag", function (hooks) {
789789
await render(<template>what</template>)
790790
assert.dom().hasText("what")
791791
})
792+
793+
test("it has a template tag with a tag", async function (assert) {
794+
await render(
795+
<template>
796+
<h1>what</h1>
797+
</template>,
798+
)
799+
assert.dom().hasText("what")
800+
})
801+
802+
test("it has a template tag with a block", async function (assert) {
803+
await render(
804+
<template>
805+
{{#if true}}
806+
what
807+
{{/if}}
808+
</template>,
809+
)
810+
assert.dom().hasText("what")
811+
})
812+
813+
test("it has a template tag with a one-line block", async function (assert) {
814+
await render(<template>{{#if true}}what{{/if}}</template>)
815+
assert.dom().hasText("what")
816+
})
817+
818+
test("it has a template tag with a one-line block", async function (assert) {
819+
await render(<template>{{if true "what"}}</template>)
820+
assert.dom().hasText("what")
821+
})
792822
})
793823
"
794824
`;

tests/unit-tests/config/__snapshots__/template-export-default.test.ts.snap

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,36 @@ module("Render with template tag", function (hooks) {
789789
await render(<template>what</template>);
790790
assert.dom().hasText("what");
791791
});
792+
793+
test("it has a template tag with a tag", async function (assert) {
794+
await render(
795+
<template>
796+
<h1>what</h1>
797+
</template>,
798+
);
799+
assert.dom().hasText("what");
800+
});
801+
802+
test("it has a template tag with a block", async function (assert) {
803+
await render(
804+
<template>
805+
{{#if true}}
806+
what
807+
{{/if}}
808+
</template>,
809+
);
810+
assert.dom().hasText("what");
811+
});
812+
813+
test("it has a template tag with a one-line block", async function (assert) {
814+
await render(<template>{{#if true}}what{{/if}}</template>);
815+
assert.dom().hasText("what");
816+
});
817+
818+
test("it has a template tag with a one-line block", async function (assert) {
819+
await render(<template>{{if true "what"}}</template>);
820+
assert.dom().hasText("what");
821+
});
792822
});
793823
"
794824
`;

0 commit comments

Comments
 (0)