diff --git a/addon/utils/bind-data-test-attributes.js b/addon/utils/bind-data-test-attributes.js index 6d800e38..b63b6705 100644 --- a/addon/utils/bind-data-test-attributes.js +++ b/addon/utils/bind-data-test-attributes.js @@ -27,18 +27,6 @@ export default function bindDataTestAttributes(component) { 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.`; - - warn(message, false, { - id: 'ember-test-selectors.computed-attribute-bindings', - }); - - return; - } - let attributeBindings = component.getWithDefault('attributeBindings', []); if (!isArray(attributeBindings)) { attributeBindings = [attributeBindings]; @@ -48,5 +36,15 @@ export default function bindDataTestAttributes(component) { dataTestProperties.forEach(it => attributeBindings.push(it)); - component.set('attributeBindings', attributeBindings); + try { + component.set('attributeBindings', attributeBindings); + + } catch (error) { + let message = `ember-test-selectors could not bind data-test-* properties on ${component} ` + + `automatically because "attributeBindings" is a read-only property.`; + + warn(message, false, { + id: 'ember-test-selectors.computed-attribute-bindings', + }); + } } diff --git a/package.json b/package.json index dbcdd407..227a13fa 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "ember-disable-prototype-extensions": "^1.1.2", "ember-load-initializers": "^1.0.0", "ember-resolver": "^4.3.0", - "ember-source": "~2.18.0", + "ember-source": "~3.0.0", "eslint": "^4.2.0", "eslint-config-simplabs": "^0.4.0", "eslint-plugin-ember": "^3.6.2", diff --git a/yarn.lock b/yarn.lock index 6264dda1..06002607 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2252,9 +2252,9 @@ ember-router-generator@^1.0.0, ember-router-generator@^1.2.3: dependencies: recast "^0.11.3" -ember-source@~2.18.0: - version "2.18.2" - resolved "https://registry.yarnpkg.com/ember-source/-/ember-source-2.18.2.tgz#75d00eef5488bfe504044b025c752ba924eaf87f" +ember-source@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ember-source/-/ember-source-3.0.0.tgz#51811cae98d2ceec53bcfbaa876d02b2b5b2159f" dependencies: broccoli-funnel "^2.0.1" broccoli-merge-trees "^2.0.0" @@ -2263,7 +2263,6 @@ ember-source@~2.18.0: ember-cli-normalize-entity-name "^1.0.0" ember-cli-path-utils "^1.0.0" ember-cli-string-utils "^1.1.0" - ember-cli-test-info "^1.0.0" ember-cli-valid-component-name "^1.0.0" ember-cli-version-checker "^2.1.0" ember-router-generator "^1.2.3"