Skip to content

Commit 54f7671

Browse files
authored
Expanding embroider test coverage (salsify#277)
1 parent c33a8f7 commit 54f7671

File tree

4 files changed

+44
-26
lines changed

4 files changed

+44
-26
lines changed

test-packages/embroider-app/ember-cli-build.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ module.exports = function (defaults) {
1111

1212
return compatBuild(app, Webpack, {
1313
staticAddonTestSupportTrees: true,
14-
staticAddonTrees: true,
1514
staticHelpers: true,
16-
// staticComponents: true,
15+
16+
// Due to runtime use of dynamic require(), we need staticAddonsTrees:false
17+
// to preserve style modules in addons and staticComponents:false to
18+
// preserve style modules in apps.
19+
staticAddonTrees: false,
20+
staticComponents: false,
1721
});
1822
};

test-packages/embroider-app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"eslint-plugin-qunit": "^6.2.0",
5757
"loader.js": "^4.7.0",
5858
"npm-run-all": "^4.1.5",
59+
"octane-addon": "link:../octane-addon",
5960
"prettier": "^2.3.2",
6061
"qunit": "^2.16.0",
6162
"qunit-dom": "^1.6.0",
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { module, test } from 'qunit';
2+
import { setupRenderingTest } from 'ember-qunit';
3+
import { render } from '@ember/test-helpers';
4+
import { hbs } from 'ember-cli-htmlbars';
5+
6+
module('Integration | Component | from addon', function (hooks) {
7+
setupRenderingTest(hooks);
8+
9+
test('MyMessageComponent renders with styles', async function (assert) {
10+
await render(hbs`
11+
<MyMessageComponent @error={{this.isError}} >
12+
<div data-test-target></div>
13+
</MyMessageComponent>
14+
`);
15+
16+
assert.equal(
17+
getComputedStyle(document.querySelector('[data-test-target]')).color,
18+
'rgb(0, 102, 0)'
19+
);
20+
this.set('isError', true);
21+
assert.equal(
22+
getComputedStyle(document.querySelector('[data-test-target]')).color,
23+
'rgb(204, 0, 0)'
24+
);
25+
});
26+
});

yarn.lock

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3558,24 +3558,6 @@ broccoli-clean-css@^1.1.0:
35583558
inline-source-map-comment "^1.0.5"
35593559
json-stable-stringify "^1.0.0"
35603560

3561-
broccoli-concat@^3.2.2:
3562-
version "3.7.5"
3563-
resolved "https://registry.yarnpkg.com/broccoli-concat/-/broccoli-concat-3.7.5.tgz#223beda8c1184252cf08ae020a3d45ffa6a48218"
3564-
integrity sha512-rDs1Mej3Ej0Cy5yIO9oIQq5+BCv0opAwS2NW7M0BeCsAMeFM42Z/zacDUC6jKc5OV5wiHvGTyCPLnZkMe0h6kQ==
3565-
dependencies:
3566-
broccoli-debug "^0.6.5"
3567-
broccoli-kitchen-sink-helpers "^0.3.1"
3568-
broccoli-plugin "^1.3.0"
3569-
ensure-posix-path "^1.0.2"
3570-
fast-sourcemap-concat "^1.4.0"
3571-
find-index "^1.1.0"
3572-
fs-extra "^4.0.3"
3573-
fs-tree-diff "^0.5.7"
3574-
lodash.merge "^4.6.2"
3575-
lodash.omit "^4.1.0"
3576-
lodash.uniq "^4.2.0"
3577-
walk-sync "^0.3.2"
3578-
35793561
broccoli-concat@^4.2.4, broccoli-concat@^4.2.5:
35803562
version "4.2.5"
35813563
resolved "https://registry.yarnpkg.com/broccoli-concat/-/broccoli-concat-4.2.5.tgz#d578f00094048b5fc87195e82fbdbde20d838d29"
@@ -5891,23 +5873,21 @@ ember-compatibility-helpers@^1.1.2, ember-compatibility-helpers@^1.2.0, ember-co
58915873
semver "^5.4.1"
58925874

58935875
"ember-css-modules@link:packages/ember-css-modules":
5894-
version "1.6.0"
5876+
version "2.0.1"
58955877
dependencies:
58965878
broccoli-bridge "^1.0.0"
5897-
broccoli-concat "^3.2.2"
5879+
broccoli-concat "^4.2.5"
58985880
broccoli-css-modules "^0.8.0"
58995881
broccoli-funnel "^3.0.8"
59005882
broccoli-merge-trees "^4.2.0"
59015883
broccoli-postcss "^6.0.0"
59025884
debug "^4.3.2"
59035885
ember-cli-babel "^7.26.6"
59045886
ember-cli-htmlbars "^6.0.0"
5905-
ember-cli-version-checker "^2.1.0"
59065887
ensure-posix-path "^1.0.2"
59075888
hash-string "^1.0.0"
59085889
lodash.merge "^4.6.1"
59095890
postcss "^8.0.0"
5910-
semver "^7.3.5"
59115891
toposort "^2.0.2"
59125892

59135893
ember-data@~3.28.0:
@@ -7293,7 +7273,7 @@ fs-merger@^3.2.1:
72937273
fs-tree-diff "^2.0.1"
72947274
walk-sync "^2.2.0"
72957275

7296-
fs-tree-diff@^0.5.2, fs-tree-diff@^0.5.3, fs-tree-diff@^0.5.4, fs-tree-diff@^0.5.6, fs-tree-diff@^0.5.7, fs-tree-diff@^0.5.9:
7276+
fs-tree-diff@^0.5.2, fs-tree-diff@^0.5.3, fs-tree-diff@^0.5.4, fs-tree-diff@^0.5.6, fs-tree-diff@^0.5.9:
72977277
version "0.5.9"
72987278
resolved "https://registry.yarnpkg.com/fs-tree-diff/-/fs-tree-diff-0.5.9.tgz#a4ec6182c2f5bd80b9b83c8e23e4522e6f5fd946"
72997279
integrity sha512-872G8ax0kHh01m9n/2KDzgYwouKza0Ad9iFltBpNykvROvf2AGtoOzPJgGx125aolGPER3JuC7uZFrQ7bG1AZw==
@@ -9937,6 +9917,13 @@ object.pick@^1.3.0:
99379917
dependencies:
99389918
isobject "^3.0.1"
99399919

9920+
"octane-addon@link:test-packages/octane-addon":
9921+
version "0.0.0"
9922+
dependencies:
9923+
ember-cli-babel "^7.23.0"
9924+
ember-cli-htmlbars "^5.3.1"
9925+
ember-css-modules "link:packages/ember-css-modules"
9926+
99409927
on-finished@~2.3.0:
99419928
version "2.3.0"
99429929
resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947"
@@ -12876,7 +12863,7 @@ walk-sync@^0.2.5:
1287612863
ensure-posix-path "^1.0.0"
1287712864
matcher-collection "^1.0.0"
1287812865

12879-
walk-sync@^0.3.0, walk-sync@^0.3.1, walk-sync@^0.3.2, walk-sync@^0.3.3:
12866+
walk-sync@^0.3.0, walk-sync@^0.3.1, walk-sync@^0.3.3:
1288012867
version "0.3.4"
1288112868
resolved "https://registry.yarnpkg.com/walk-sync/-/walk-sync-0.3.4.tgz#cf78486cc567d3a96b5b2237c6108017a5ffb9a4"
1288212869
integrity sha512-ttGcuHA/OBnN2pcM6johpYlEms7XpO5/fyKIr48541xXedan4roO8cS1Q2S/zbbjGH/BarYDAMeS2Mi9HE5Tig==

0 commit comments

Comments
 (0)