Skip to content

Commit 6dc818c

Browse files
committed
Ensure component unit/integration tests are correct.
1 parent ebe7a4e commit 6dc818c

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

lib/engines/classic/test-file-info.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ Object.defineProperty(TestFileInfo.prototype, 'destRelativePath', {
5151
var privateRenderableInvoker = this._fileInfoCollection.detectPrivateRenderableInvoker(renderableName);
5252

5353
if (privateRenderableInvoker) {
54-
var invokerLocation = path.dirname(privateRenderableInvoker.destRelativePath);
55-
var privateCollection = invokerLocation.indexOf('-components') > -1 ? '' : '-components';
54+
var invokerLocation = path.dirname(this._privateRenderableInvoker.destRelativePath);
55+
var invokerInComponentsCollection = privateRenderableInvoker.collection === 'components';
56+
var invokerInPrivateCollection = invokerLocation.indexOf('-components') > -1;
57+
var privateCollection = invokerInPrivateCollection || invokerInComponentsCollection? '' : '-components';
5658

5759
return path.join(
5860
invokerLocation,

test/fixtures/classic-private-components/input.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ module.exports = {
1313
},
1414

1515
tests: {
16-
16+
integration: {
17+
components: {
18+
'x-bar-test.js': 'x-bar component test'
19+
}
20+
}
1721
}
1822
};

test/fixtures/classic-private-components/output.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ module.exports = {
55
'x-foo': {
66
'template.hbs': 'x-foo template: {{x-bar}}',
77
'x-bar': {
8-
'template.hbs': 'x-bar template'
8+
'template.hbs': 'x-bar template',
9+
'component-integration-test.js': 'x-bar component test'
910
}
1011
}
1112
},

0 commit comments

Comments
 (0)