From dfe9731261ba68edc9e382b04619de01e3171367 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Mon, 27 Mar 2017 15:58:27 -0700 Subject: [PATCH] 0.3.0 --- tests/dummy/app/components/print-test-attributes.js | 11 +++++++++++ .../templates/components/print-test-attributes.hbs | 1 + ...strip-data-test-attributes-from-components-test.js | 6 ++++++ 3 files changed, 18 insertions(+) create mode 100644 tests/dummy/app/components/print-test-attributes.js diff --git a/tests/dummy/app/components/print-test-attributes.js b/tests/dummy/app/components/print-test-attributes.js new file mode 100644 index 00000000..0e5bb2f1 --- /dev/null +++ b/tests/dummy/app/components/print-test-attributes.js @@ -0,0 +1,11 @@ +import Ember from 'ember'; + +const { Component } = Ember; + +const component = Component.extend(); + +component.reopenClass({ + positionalParams: 'params' +}); + +export default component; diff --git a/tests/dummy/app/templates/components/print-test-attributes.hbs b/tests/dummy/app/templates/components/print-test-attributes.hbs index 990e1941..60bf5127 100644 --- a/tests/dummy/app/templates/components/print-test-attributes.hbs +++ b/tests/dummy/app/templates/components/print-test-attributes.hbs @@ -2,3 +2,4 @@
{{data-test-second}}
{{data-non-test}}
{{data-test}}
+
{{params.length}}
\ No newline at end of file diff --git a/tests/integration/strip-data-test-attributes-from-components-test.js b/tests/integration/strip-data-test-attributes-from-components-test.js index 43e59e90..24ef2b21 100644 --- a/tests/integration/strip-data-test-attributes-from-components-test.js +++ b/tests/integration/strip-data-test-attributes-from-components-test.js @@ -9,6 +9,12 @@ moduleForComponent('print-test-attributes', 'StripTestSelectorsTransform plugin' if (config.stripTestSelectors) { + test('it strips data-test-* attributes from components with positional params', function(assert) { + this.render(hbs`{{print-test-attributes "param1" data-test-first}}`); + + assert.equal(this.$('.data-test-positional-params').text(), 1, 'there should be only one param'); + }); + test('it strips data-test-* attributes from components', function(assert) { this.render(hbs`{{print-test-attributes data-test-first="foobar"}}`);