Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module('Integration | Template AST Plugin', function(hooks) {
hooks.beforeEach(function() {
this.owner.register('template:components/x-div', hbs`{{yield}}`);
this.owner.register('component:x-div', Component.extend({ attributeBindings: ['data-test-value'] }));
this.owner.register('helper:helper', helper((params, hash) => {
this.owner.register('helper:custom-helper', helper((params, hash) => {
const values = Object.keys(hash).map(key => hash[key]);
return params.concat(values).join(' ');
}));
Expand Down Expand Up @@ -137,8 +137,8 @@ module('Integration | Template AST Plugin', function(hooks) {
});

testTransformation('creating a class attribute with dynamic local-class value', {
statementInput: 'local-class=(helper positional "bar" keyA=named keyB="qux")',
elementInput: 'local-class={{helper positional "bar" keyA=named keyB="qux"}}',
statementInput: 'local-class=(custom-helper positional "bar" keyA=named keyB="qux")',
elementInput: 'local-class={{custom-helper positional "bar" keyA=named keyB="qux"}}',
output: 'class="--foo --bar --baz --qux"',

selector: '.--foo.--bar.--baz.--qux',
Expand All @@ -155,8 +155,8 @@ module('Integration | Template AST Plugin', function(hooks) {
});

testTransformation('creating a class attribute with mixed local-class value', {
statementInput: 'local-class=(concat "foo " (helper positional "bar" keyA=named keyB="qux"))',
elementInput: 'local-class="foo {{helper positional "bar" keyA=named keyB="qux"}}"',
statementInput: 'local-class=(concat "foo " (custom-helper positional "bar" keyA=named keyB="qux"))',
elementInput: 'local-class="foo {{custom-helper positional "bar" keyA=named keyB="qux"}}"',
output: 'class="--foo --fizz --bar --baz --qux"',

selector: '.--foo.--fizz.--bar.--baz.--qux',
Expand All @@ -174,8 +174,8 @@ module('Integration | Template AST Plugin', function(hooks) {
});

testTransformation('appending a class attribute with dynamic local-class value', {
statementInput: 'class="x" local-class=(helper positional "bar" keyA=named keyB="qux")',
elementInput: 'class="x" local-class={{helper positional "bar" keyA=named keyB="qux"}}',
statementInput: 'class="x" local-class=(custom-helper positional "bar" keyA=named keyB="qux")',
elementInput: 'class="x" local-class={{custom-helper positional "bar" keyA=named keyB="qux"}}',
output: 'class="x --foo --bar --baz --qux"',

selector: '.x.--foo.--bar.--baz.--qux',
Expand All @@ -192,8 +192,8 @@ module('Integration | Template AST Plugin', function(hooks) {
});

testTransformation('appending a class attribute with mixed local-class value', {
statementInput: 'class="x" local-class=(concat "foo " (helper positional "bar" keyA=named keyB="qux"))',
elementInput: 'class="x" local-class="foo {{helper positional "bar" keyA=named keyB="qux"}}"',
statementInput: 'class="x" local-class=(concat "foo " (custom-helper positional "bar" keyA=named keyB="qux"))',
elementInput: 'class="x" local-class="foo {{custom-helper positional "bar" keyA=named keyB="qux"}}"',
output: 'class="x --foo --fizz --bar --baz --qux"',

selector: '.x.--foo.--bar.--baz.--qux',
Expand Down
3 changes: 2 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6059,7 +6059,7 @@ ember-compatibility-helpers@^1.0.2, ember-compatibility-helpers@^1.1.1, ember-co
semver "^5.4.1"

"ember-css-modules@link:packages/ember-css-modules":
version "1.3.1"
version "1.3.3"
dependencies:
broccoli-bridge "^1.0.0"
broccoli-concat "^3.2.2"
Expand Down Expand Up @@ -12759,6 +12759,7 @@ temp@^0.8.3:

"template-stuff@link:packages/ember-css-modules/tests/dummy/lib/template-stuff":
version "0.0.0"
uid ""

terser-webpack-plugin@^1.1.0, terser-webpack-plugin@^1.4.3:
version "1.4.3"
Expand Down