Skip to content

Commit

Permalink
0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbo87 committed Apr 7, 2017
1 parent 3d68a4a commit dfe9731
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/dummy/app/components/print-test-attributes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Ember from 'ember';

const { Component } = Ember;

const component = Component.extend();

component.reopenClass({
positionalParams: 'params'
});

export default component;
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
<div class="data-test-second">{{data-test-second}}</div>
<div class="data-non-test">{{data-non-test}}</div>
<div class="data-test">{{data-test}}</div>
<div class="data-test-positional-params">{{params.length}}</div>
Original file line number Diff line number Diff line change
Expand Up @@ -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"}}`);

Expand Down

0 comments on commit dfe9731

Please sign in to comment.