Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use new module imports #127

Merged
merged 3 commits into from
Jul 7, 2017
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
13 changes: 8 additions & 5 deletions addon/utils/bind-data-test-attributes.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Ember from 'ember';

const { warn, isArray } = Ember;
import { warn } from '@ember/debug';
import { isArray } from '@ember/array';

const TEST_SELECTOR_PREFIX = /data-test-.*/;

Expand All @@ -21,19 +20,23 @@ export default function bindDataTestAttributes(component) {
let message = `ember-test-selectors could not bind data-test-* properties on ${component} ` +
`automatically because tagName is empty.`;

return warn(message, false, {
warn(message, false, {
id: 'ember-test-selectors.empty-tag-name',
});

return;
}

let computedBindings = component.attributeBindings && component.attributeBindings.isDescriptor;
if (computedBindings) {
let message = `ember-test-selectors could not bind data-test-* properties on ${component} ` +
`automatically because attributeBindings is a computed property.`;

return warn(message, false, {
warn(message, false, {
id: 'ember-test-selectors.computed-attribute-bindings',
});

return;
}

let attributeBindings = component.getWithDefault('attributeBindings', []);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"dependencies": {
"broccoli-stew": "^1.4.0",
"ember-cli-babel": "^6.0.0",
"ember-cli-babel": "^6.6.0",
"ember-cli-version-checker": "^2.0.0"
},
"devDependencies": {
Expand Down
4 changes: 1 addition & 3 deletions tests/unit/utils/bind-data-test-attributes-test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { module, test } from 'qunit';
import Ember from 'ember';
import EmberObject, { computed } from '@ember/object';

import bindDataTestAttributes from 'ember-test-selectors/utils/bind-data-test-attributes';

const { Object: EmberObject, computed } = Ember;

module('Unit | Utility | bind data test attributes');

test('it adds missing attributeBindings array', function(assert) {
Expand Down