Skip to content

Commit d5768b3

Browse files
committed
Fix nested component detection
1 parent 2ecc18c commit d5768b3

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

transforms/angle-brackets/transform.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ function isBuiltInComponent(key) {
4646
}
4747

4848
function isNestedComponentTagName(tagName) {
49-
return tagName && tagName.includes && (tagName.includes('/') || tagName.includes('-'));
49+
return (
50+
tagName &&
51+
tagName.includes &&
52+
(tagName.includes('/') || (tagName.includes('-') && tagName.includes('.')))
53+
);
5054
}
5155

5256
function isWallStreet(tagName) {

transforms/angle-brackets/transform.test.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ test('tilde', () => {
878878
expect(runTest('tilde.hbs', input)).toMatchInlineSnapshot(`
879879
"
880880
{{#if foo~}}
881-
<SomeComponent />
881+
{{some-component}}
882882
{{/if}}
883883
"
884884
`);
@@ -1370,3 +1370,19 @@ test('yield', () => {
13701370

13711371
expect(runTestWithData('pipe.hbs', input, {}, {})).toMatchInlineSnapshot(`"{{yield}}"`);
13721372
});
1373+
1374+
test('unknown helper with args', () => {
1375+
let input = `
1376+
{{api-reference component=this.currentComponent}}
1377+
{{api-reference someArg}}
1378+
{{api-reference}}
1379+
`;
1380+
1381+
expect(runTestWithData('pipe.hbs', input, {}, {})).toMatchInlineSnapshot(`
1382+
"
1383+
<ApiReference @component={{this.currentComponent}} />
1384+
{{api-reference someArg}}
1385+
{{api-reference}}
1386+
"
1387+
`);
1388+
});

0 commit comments

Comments
 (0)