Skip to content

Commit

Permalink
Use new module imports (#127)
Browse files Browse the repository at this point in the history
* Update "ember-cli-babel" to v6.6.0

* Use new module imports

* Split "return" keyword and warn() invocations

This messes up the debug macros Babel plugin apparently...
  • Loading branch information
Turbo87 authored and marcoow committed Jul 7, 2017
1 parent a36560f commit 60cd80b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
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

0 comments on commit 60cd80b

Please sign in to comment.