Skip to content

Commit 76df4fb

Browse files
Turbo87tylerturdenpants
authored andcommitted
Add test case for nested else if (#163)
1 parent dce646e commit 76df4fb

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

transforms/angle-brackets/test.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,38 @@ test('if', () => {
294294
`);
295295
});
296296

297+
test('nested-else-if', () => {
298+
let input = `
299+
{{#if a}}
300+
{{my-component1 foo="bar"}}
301+
{{else if b}}
302+
{{my-component2 foo="bar"}}
303+
{{else if c}}
304+
{{my-component3 foo="bar"}}
305+
{{else if d}}
306+
{{my-component4 foo="bar"}}
307+
{{else}}
308+
{{my-component5 foo="bar"}}
309+
{{/if}}
310+
`;
311+
312+
expect(runTest('if.hbs', input)).toMatchInlineSnapshot(`
313+
"
314+
{{#if a}}
315+
<MyComponent1 @foo=\\"bar\\" />
316+
{{else if b}}
317+
<MyComponent2 @foo=\\"bar\\" />
318+
{{else if c}}
319+
<MyComponent3 @foo=\\"bar\\" />
320+
{{else if d}}
321+
<MyComponent4 @foo=\\"bar\\" />
322+
{{else}}
323+
<MyComponent5 @foo=\\"bar\\" />
324+
{{/if}}
325+
"
326+
`);
327+
});
328+
297329
test('input-helper', () => {
298330
let input = `
299331
{{input type="checkbox" name="email-opt-in" checked=this.model.emailPreference}}

0 commit comments

Comments
 (0)