Skip to content

Commit

Permalink
Add test case for nested else if (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbo87 authored and tylerturdenpants committed Oct 11, 2019
1 parent dce646e commit 76df4fb
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions transforms/angle-brackets/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,38 @@ test('if', () => {
`);
});

test('nested-else-if', () => {
let input = `
{{#if a}}
{{my-component1 foo="bar"}}
{{else if b}}
{{my-component2 foo="bar"}}
{{else if c}}
{{my-component3 foo="bar"}}
{{else if d}}
{{my-component4 foo="bar"}}
{{else}}
{{my-component5 foo="bar"}}
{{/if}}
`;

expect(runTest('if.hbs', input)).toMatchInlineSnapshot(`
"
{{#if a}}
<MyComponent1 @foo=\\"bar\\" />
{{else if b}}
<MyComponent2 @foo=\\"bar\\" />
{{else if c}}
<MyComponent3 @foo=\\"bar\\" />
{{else if d}}
<MyComponent4 @foo=\\"bar\\" />
{{else}}
<MyComponent5 @foo=\\"bar\\" />
{{/if}}
"
`);
});

test('input-helper', () => {
let input = `
{{input type="checkbox" name="email-opt-in" checked=this.model.emailPreference}}
Expand Down

0 comments on commit 76df4fb

Please sign in to comment.