Skip to content

Commit

Permalink
Address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Demboski committed Jan 31, 2019
1 parent 7ce614b commit 7382299
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions addon/utils/bind-data-test-attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ export default function bindDataTestAttributes(component) {
if (!component.get('supportsDataTestProperties')) {
let tagName = component.get('tagName');

let message = `ember-test-selectors could not bind data-test-* properties on ${component} ` +
`automatically because tagName is empty.`;
let message = String(`ember-test-selectors could not bind data-test-* properties on ${component} ` +
`automatically because tagName is empty. If you did this intentionally, see ` +
`https://github.com/simplabs/ember-test-selectors#usage-in-computed-properties ` +
`for instructions on how to disable this assertion.`);

assert(message, tagName !== '', {
id: 'ember-test-selectors.empty-tag-name',
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/utils/bind-data-test-attributes-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ test('it breaks if tagName is empty', function(assert) {
});

test('it does not breaks if tagName is empty and supportsDataTestProperties is set', function(assert) {
assert.expect(0);

let Fixture = EmberObject.extend({
tagName: '',
supportsDataTestProperties: true,
Expand All @@ -140,7 +142,6 @@ test('it does not breaks if tagName is empty and supportsDataTestProperties is s
});

bindDataTestAttributes(instance);
assert.ok(true, 'did not throw');
});

test('issue #106', function(assert) {
Expand Down

0 comments on commit 7382299

Please sign in to comment.