diff --git a/index.js b/index.js index fe5bea28..fe3d559b 100644 --- a/index.js +++ b/index.js @@ -55,13 +55,9 @@ module.exports = { let host = this._findHost(); this._assignOptions(host); - let emberChecker = new VersionChecker(app).forEmber(); - - if (emberChecker.isAbove('1.13.0')) { - // we can't use the setupPreprocessorRegistry() hook as it is called to - // early and we do not have reliable access to `app.tests` there yet - this._setupPreprocessorRegistry(app.registry); - } + // we can't use the setupPreprocessorRegistry() hook as it is called to + // early and we do not have reliable access to `app.tests` there yet + this._setupPreprocessorRegistry(app.registry); // add the StripDataTestPropertiesPlugin to the list of plugins used by // the `ember-cli-babel` addon diff --git a/package.json b/package.json index 74d2ec67..d263d29f 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,6 @@ "ember-cli-inject-live-reload": "^1.6.1", "ember-cli-qunit": "^4.0.0", "ember-cli-shims": "^1.1.0", - "ember-compatibility-helpers": "^0.1.2", "ember-disable-prototype-extensions": "^1.1.2", "ember-load-initializers": "^1.0.0", "ember-resolver": "^4.3.0", diff --git a/strip-test-selectors.js b/strip-test-selectors.js index 28e94ec4..f6aeea2a 100644 --- a/strip-test-selectors.js +++ b/strip-test-selectors.js @@ -21,6 +21,10 @@ StripTestSelectorsTransform.prototype.transform = function(ast) { return !isTestSelector(attribute.name); }); } else if (node.type === 'MustacheStatement' || node.type === 'BlockStatement') { + if ('sexpr' in node) { + node = node.sexpr; + } + node.params = node.params.filter(function(param) { return !isTestSelector(param.original); }); diff --git a/tests/acceptance/bind-data-test-attributes-in-components-test.js b/tests/acceptance/bind-data-test-attributes-in-components-test.js index 2ff12cd3..07bc60bb 100644 --- a/tests/acceptance/bind-data-test-attributes-in-components-test.js +++ b/tests/acceptance/bind-data-test-attributes-in-components-test.js @@ -1,9 +1,8 @@ -import { test } from 'qunit'; +import { test, skip } from 'qunit'; import moduleForAcceptance from '../../tests/helpers/module-for-acceptance'; import config from 'dummy/config/environment'; - -import { GTE_EMBER_1_13 } from 'ember-compatibility-helpers'; +import { hasPositionalParams } from 'dummy/version-checks'; if (!config.stripTestSelectors) { @@ -49,25 +48,23 @@ if (!config.stripTestSelectors) { assert.equal(find('.test6').find('div[data-non-test]').length, 0, 'data-non-test does not exists'); }); - if (GTE_EMBER_1_13) { - test('it binds data-test-* attributes with boolean values on components', function(assert) { - assert.equal(find('.test7').find('div[data-test-with-boolean-value]').length, 1, 'data-test-with-boolean-value exists'); - }); + test('it binds data-test-* attributes with boolean values on components', function(assert) { + assert.equal(find('.test7').find('div[data-test-with-boolean-value]').length, 1, 'data-test-with-boolean-value exists'); + }); - test('it binds data-test-* attributes without values on components', function(assert) { - assert.equal(find('.test8').find('div[data-test-without-value]').length, 1, 'data-test-without-value exists'); - }); + test('it binds data-test-* attributes without values on components', function(assert) { + assert.equal(find('.test8').find('div[data-test-without-value]').length, 1, 'data-test-without-value exists'); + }); - test('it binds data-test-* attributes without values on block components', function(assert) { - assert.equal(find('.test9').find('div[data-test-without-value]').length, 1, 'data-test-without-value exists'); - }); + test('it binds data-test-* attributes without values on block components', function(assert) { + assert.equal(find('.test9').find('div[data-test-without-value]').length, 1, 'data-test-without-value exists'); + }); - test('it leaves data-test attribute without value untouched on components', function(assert) { - assert.equal(find('.test10').find('div[data-test]').length, 0, 'data-test does not exists'); - }); + (hasPositionalParams ? test : skip)('it leaves data-test attribute without value untouched on components', function(assert) { + assert.equal(find('.test10').find('div[data-test]').length, 0, 'data-test does not exists'); + }); - test('it transforms data-test params to hash pairs on components', function(assert) { - assert.equal(find('.test11').find('div[data-test-something]').length, 1, 'data-test-something exists'); - }); - } + test('it transforms data-test params to hash pairs on components', function(assert) { + assert.equal(find('.test11').find('div[data-test-something]').length, 1, 'data-test-something exists'); + }); } diff --git a/tests/dummy/app/controllers/bind-test.js b/tests/dummy/app/controllers/bind-test.js index 698f0311..eccfa039 100644 --- a/tests/dummy/app/controllers/bind-test.js +++ b/tests/dummy/app/controllers/bind-test.js @@ -1,8 +1,8 @@ import Ember from 'ember'; -import { GTE_EMBER_1_13 } from 'ember-compatibility-helpers'; +import { hasPositionalParams } from 'dummy/version-checks'; const { Controller } = Ember; export default Controller.extend({ - shouldRenderParamTests: GTE_EMBER_1_13 + hasPositionalParams, }); diff --git a/tests/dummy/app/templates/bind-test.hbs b/tests/dummy/app/templates/bind-test.hbs index b033067d..684f582c 100644 --- a/tests/dummy/app/templates/bind-test.hbs +++ b/tests/dummy/app/templates/bind-test.hbs @@ -12,12 +12,12 @@