From 1dfb978416b041a99dee7070d5a578076db6e9e3 Mon Sep 17 00:00:00 2001 From: Marco Otte-Witte Date: Fri, 25 Nov 2016 15:12:26 +0100 Subject: [PATCH 1/5] update libraries --- .gitignore | 2 +- .travis.yml | 22 +++++++++++++---- bower.json | 5 ++-- config/ember-try.js | 12 +++++++++- index.js | 4 +++- package.json | 39 +++++++++++++++++-------------- tests/dummy/config/environment.js | 4 ++++ tests/index.html | 2 +- 8 files changed, 61 insertions(+), 29 deletions(-) diff --git a/.gitignore b/.gitignore index 86fceae7..373de6a2 100644 --- a/.gitignore +++ b/.gitignore @@ -13,5 +13,5 @@ /connect.lock /coverage/* /libpeerconnection.log -npm-debug.log +npm-debug.log* testem.log diff --git a/.travis.yml b/.travis.yml index 22816447..446db6be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ --- language: node_js node_js: - - "0.12" + - "4" sudo: false @@ -9,20 +9,34 @@ cache: directories: - node_modules +env: + - EMBER_TRY_SCENARIO=ember-1.13 + - EMBER_TRY_SCENARIO=ember-lts-2.4 + - EMBER_TRY_SCENARIO=ember-release + - EMBER_TRY_SCENARIO=ember-beta + - EMBER_TRY_SCENARIO=ember-canary + +matrix: + fast_finish: true + allow_failures: + - env: EMBER_TRY_SCENARIO=ember-canary + before_install: - npm config set spin false - npm install -g bower - bower --version - npm install phantomjs-prebuilt - - phantomjs --version + - node_modules/phantomjs-prebuilt/bin/phantomjs --version install: - npm install - bower install script: - - npm run-script test - - npm run-script jshint + # Usually, it's ok to finish the test scenario without reverting + # to the addon's original dependency state, skipping "cleanup". + - ember try:one $EMBER_TRY_SCENARIO test --skip-cleanup + - npm run mocha notifications: email: false diff --git a/bower.json b/bower.json index eb62383d..cef9cd12 100644 --- a/bower.json +++ b/bower.json @@ -1,8 +1,7 @@ { "name": "ember-test-selectors", "dependencies": { - "ember": "~2.7.0", - "ember-cli-shims": "0.1.1", - "ember-qunit-notifications": "0.1.0" + "ember": "~2.9.0", + "ember-cli-shims": "0.1.3" } } diff --git a/config/ember-try.js b/config/ember-try.js index f5a25f4c..0355b5ff 100644 --- a/config/ember-try.js +++ b/config/ember-try.js @@ -1,6 +1,5 @@ /*jshint node:true*/ module.exports = { - useVersionCompatibility: true, scenarios: [ { name: 'ember-1.13', @@ -13,6 +12,17 @@ module.exports = { } } }, + { + name: 'ember-lts-2.4', + bower: { + dependencies: { + 'ember': 'components/ember#lts-2-4' + }, + resolutions: { + 'ember': 'lts-2-4' + } + } + }, { name: 'ember-release', bower: { diff --git a/index.js b/index.js index aa2b75bf..3e079bbe 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,6 @@ -/*jshint node:true*/ +/* jshint node:true */ +'use strict'; + var _includes = require('lodash/includes'); module.exports = { diff --git a/package.json b/package.json index 0d37bfb7..b80f1793 100644 --- a/package.json +++ b/package.json @@ -1,41 +1,44 @@ { "name": "ember-test-selectors", "version": "0.0.5", - "description": "Enabling better Test selectors in Ember.js applications", + "description": "Enabling better Test selectors in Ember.js applications.", "directories": { "doc": "doc", "test": "tests" }, "scripts": { - "test": "ember try:each", - "jshint": "mocha" + "build": "ember build", + "start": "ember server", + "test": "ember try:each" }, "repository": "https://github.com/simplabs/ember-test-selectors", "engines": { - "node": ">= 0.10.0" + "node": ">= 0.12.0" }, "author": "", "license": "MIT", "devDependencies": { - "broccoli-asset-rev": "^2.4.2", - "ember-ajax": "^2.0.1", - "ember-cli": "2.7.0", - "ember-cli-app-version": "^1.0.0", - "ember-cli-dependency-checker": "^1.2.0", - "ember-cli-htmlbars": "^1.0.3", - "ember-cli-htmlbars-inline-precompile": "^0.3.1", - "ember-cli-inject-live-reload": "^1.4.0", - "ember-cli-jshint": "^1.0.0", - "ember-cli-qunit": "^2.0.0", + "broccoli-asset-rev": "^2.4.5", + "ember-ajax": "^2.4.1", + "ember-cli": "2.9.1", + "ember-cli-app-version": "^2.0.0", + "ember-cli-dependency-checker": "^1.3.0", + "ember-cli-htmlbars": "^1.0.10", + "ember-cli-htmlbars-inline-precompile": "^0.3.3", + "ember-cli-inject-live-reload": "^1.4.1", + "ember-cli-jshint": "^1.0.4", + "ember-cli-qunit": "^3.0.1", "ember-cli-release": "^0.2.9", "ember-cli-sri": "^2.1.0", "ember-cli-test-loader": "^1.1.0", "ember-cli-uglify": "^1.2.0", - "ember-data": "^2.7.0", + "ember-data": "^2.9.0", "ember-disable-prototype-extensions": "^1.1.0", "ember-export-application-global": "^1.0.5", + "ember-load-initializers": "^0.5.1", "ember-resolver": "^2.0.3", - "loader.js": "^4.0.1", + "ember-welcome-page": "^1.0.3", + "loader.js": "^4.0.10", "mocha": "^1.21.4", "mocha-jshint": "^2.3.1" }, @@ -43,8 +46,8 @@ "ember-addon" ], "dependencies": { - "ember-cli-babel": "^5.1.5", - "lodash": "^4.0.0" + "ember-cli-babel": "^5.1.7", + "lodash": "^4.0.0" }, "ember-addon": { "configPath": "tests/dummy/config", diff --git a/tests/dummy/config/environment.js b/tests/dummy/config/environment.js index 2529939c..703c4727 100644 --- a/tests/dummy/config/environment.js +++ b/tests/dummy/config/environment.js @@ -10,6 +10,10 @@ module.exports = function(environment) { FEATURES: { // Here you can enable experimental features on an ember canary build // e.g. 'with-controller': true + }, + EXTEND_PROTOTYPES: { + // Prevent Ember Data from overriding Date.parse. + Date: false } }, diff --git a/tests/index.html b/tests/index.html index f7ff6521..5209b852 100644 --- a/tests/index.html +++ b/tests/index.html @@ -21,7 +21,7 @@ {{content-for "body"}} {{content-for "test-body"}} - + From 072b3b60a224a245403b99259d45b91692ba1d81 Mon Sep 17 00:00:00 2001 From: Marco Otte-Witte Date: Fri, 25 Nov 2016 15:18:05 +0100 Subject: [PATCH 2/5] automatically add data-test-* attrs to components --- .../add-test-selectors-to-components.js | 19 +++++++++++++++++++ app/initializers/ember-test-selectors.js | 8 ++++++++ index.js | 2 +- package.json | 1 - .../components/test-component-with-impl.js | 3 +++ ...-test.hbs => test-component-with-impl.hbs} | 0 .../test-component-without-impl.hbs | 4 ++++ tests/dummy/app/templates/index.hbs | 2 ++ 8 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 addon/initializers/add-test-selectors-to-components.js create mode 100644 app/initializers/ember-test-selectors.js create mode 100644 tests/dummy/app/components/test-component-with-impl.js rename tests/dummy/app/templates/components/{data-test.hbs => test-component-with-impl.hbs} (100%) create mode 100644 tests/dummy/app/templates/components/test-component-without-impl.hbs create mode 100644 tests/dummy/app/templates/index.hbs diff --git a/addon/initializers/add-test-selectors-to-components.js b/addon/initializers/add-test-selectors-to-components.js new file mode 100644 index 00000000..28acf4b2 --- /dev/null +++ b/addon/initializers/add-test-selectors-to-components.js @@ -0,0 +1,19 @@ +import Ember from 'ember'; + +const { getPrototypeOf } = Object; +const { computed, Component } = Ember; + +export default function addTestSelectorsToComponents() { + Component.reopen({ + init() { + let attributeBinding = `-data-test-component-selector:data-test-component`; + this.attributeBindings = (this.attributeBindings || []).concat([attributeBinding]); + + return this._super(...arguments); + }, + + '-data-test-component-selector': computed(function() { + return getPrototypeOf(this)._debugContainerKey.replace(/^component:/, ''); + }) + }); +} diff --git a/app/initializers/ember-test-selectors.js b/app/initializers/ember-test-selectors.js new file mode 100644 index 00000000..7a426565 --- /dev/null +++ b/app/initializers/ember-test-selectors.js @@ -0,0 +1,8 @@ +import addTestSelectorsToComponents from 'ember-test-selectors/initializers/add-test-selectors-to-components'; + +export default { + name: 'ember-test-selectors', + initialize: function() { + addTestSelectorsToComponents(); + } +}; diff --git a/index.js b/index.js index 3e079bbe..001a6a79 100644 --- a/index.js +++ b/index.js @@ -4,7 +4,7 @@ var _includes = require('lodash/includes'); module.exports = { - name: 'test-selectors', + name: 'ember-test-selectors', setupPreprocessorRegistry: function(type, registry) { var appOptions = registry.app.options || {}; diff --git a/package.json b/package.json index b80f1793..7e6fecf2 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,6 @@ "ember-export-application-global": "^1.0.5", "ember-load-initializers": "^0.5.1", "ember-resolver": "^2.0.3", - "ember-welcome-page": "^1.0.3", "loader.js": "^4.0.10", "mocha": "^1.21.4", "mocha-jshint": "^2.3.1" diff --git a/tests/dummy/app/components/test-component-with-impl.js b/tests/dummy/app/components/test-component-with-impl.js new file mode 100644 index 00000000..a3e1d832 --- /dev/null +++ b/tests/dummy/app/components/test-component-with-impl.js @@ -0,0 +1,3 @@ +import Ember from 'ember'; + +export default Ember.Component.extend(); diff --git a/tests/dummy/app/templates/components/data-test.hbs b/tests/dummy/app/templates/components/test-component-with-impl.hbs similarity index 100% rename from tests/dummy/app/templates/components/data-test.hbs rename to tests/dummy/app/templates/components/test-component-with-impl.hbs diff --git a/tests/dummy/app/templates/components/test-component-without-impl.hbs b/tests/dummy/app/templates/components/test-component-without-impl.hbs new file mode 100644 index 00000000..5b9b42c8 --- /dev/null +++ b/tests/dummy/app/templates/components/test-component-without-impl.hbs @@ -0,0 +1,4 @@ +"Please disperse. Nothing to see here." - Frank Drebin + +This component only exists so we can convenietly use moduleForComponent for the +tests which check that data-test-* attributes are stripped. diff --git a/tests/dummy/app/templates/index.hbs b/tests/dummy/app/templates/index.hbs new file mode 100644 index 00000000..b2febfcc --- /dev/null +++ b/tests/dummy/app/templates/index.hbs @@ -0,0 +1,2 @@ +{{test-component-with-impl}} +{{test-component-without-impl}} \ No newline at end of file From 24416fab6b90f3bf07d8bd5a5c3917d3c2953d69 Mon Sep 17 00:00:00 2001 From: Marco Otte-Witte Date: Fri, 25 Nov 2016 16:07:44 +0100 Subject: [PATCH 3/5] add all kinds of component examples --- .../nesting-level/test-component-with-impl.js | 3 +++ .../nesting-level/test-component-with-impl.hbs | 11 +++++++++++ .../nesting-level/test-component-without-impl.hbs | 11 +++++++++++ .../components/test-component-with-impl.hbs | 13 ++++++++++--- .../components/test-component-without-impl.hbs | 13 ++++++++++--- tests/dummy/app/templates/index.hbs | 7 ++++++- 6 files changed, 51 insertions(+), 7 deletions(-) create mode 100644 tests/dummy/app/components/nesting-level/test-component-with-impl.js create mode 100644 tests/dummy/app/templates/components/nesting-level/test-component-with-impl.hbs create mode 100644 tests/dummy/app/templates/components/nesting-level/test-component-without-impl.hbs diff --git a/tests/dummy/app/components/nesting-level/test-component-with-impl.js b/tests/dummy/app/components/nesting-level/test-component-with-impl.js new file mode 100644 index 00000000..a3e1d832 --- /dev/null +++ b/tests/dummy/app/components/nesting-level/test-component-with-impl.js @@ -0,0 +1,3 @@ +import Ember from 'ember'; + +export default Ember.Component.extend(); diff --git a/tests/dummy/app/templates/components/nesting-level/test-component-with-impl.hbs b/tests/dummy/app/templates/components/nesting-level/test-component-with-impl.hbs new file mode 100644 index 00000000..c36a3202 --- /dev/null +++ b/tests/dummy/app/templates/components/nesting-level/test-component-with-impl.hbs @@ -0,0 +1,11 @@ +

Nested Test Component with implementation

+ +
+

"Please disperse. Nothing to see here." - Frank Drebin

+
+ +

+ This component only exists so we can convenietly use + moduleForComponent for the tests which check that + data-test-* attributes are stripped. +

\ No newline at end of file diff --git a/tests/dummy/app/templates/components/nesting-level/test-component-without-impl.hbs b/tests/dummy/app/templates/components/nesting-level/test-component-without-impl.hbs new file mode 100644 index 00000000..ec62ff1e --- /dev/null +++ b/tests/dummy/app/templates/components/nesting-level/test-component-without-impl.hbs @@ -0,0 +1,11 @@ +

Nested Test Component without implementation

+ +
+

"Please disperse. Nothing to see here." - Frank Drebin

+
+ +

+ This component only exists so we can convenietly use + moduleForComponent for the tests which check that + data-test-* attributes are stripped. +

\ No newline at end of file diff --git a/tests/dummy/app/templates/components/test-component-with-impl.hbs b/tests/dummy/app/templates/components/test-component-with-impl.hbs index 5b9b42c8..39c468f3 100644 --- a/tests/dummy/app/templates/components/test-component-with-impl.hbs +++ b/tests/dummy/app/templates/components/test-component-with-impl.hbs @@ -1,4 +1,11 @@ -"Please disperse. Nothing to see here." - Frank Drebin +

Test Component with implementation

-This component only exists so we can convenietly use moduleForComponent for the -tests which check that data-test-* attributes are stripped. +
+

"Please disperse. Nothing to see here." - Frank Drebin

+
+ +

+ This component only exists so we can convenietly use + moduleForComponent for the tests which check that + data-test-* attributes are stripped. +

\ No newline at end of file diff --git a/tests/dummy/app/templates/components/test-component-without-impl.hbs b/tests/dummy/app/templates/components/test-component-without-impl.hbs index 5b9b42c8..71b9c831 100644 --- a/tests/dummy/app/templates/components/test-component-without-impl.hbs +++ b/tests/dummy/app/templates/components/test-component-without-impl.hbs @@ -1,4 +1,11 @@ -"Please disperse. Nothing to see here." - Frank Drebin +

Test Component without implementation

-This component only exists so we can convenietly use moduleForComponent for the -tests which check that data-test-* attributes are stripped. +
+

"Please disperse. Nothing to see here." - Frank Drebin

+
+ +

+ This component only exists so we can convenietly use + moduleForComponent for the tests which check that + data-test-* attributes are stripped. +

\ No newline at end of file diff --git a/tests/dummy/app/templates/index.hbs b/tests/dummy/app/templates/index.hbs index b2febfcc..f53678eb 100644 --- a/tests/dummy/app/templates/index.hbs +++ b/tests/dummy/app/templates/index.hbs @@ -1,2 +1,7 @@ {{test-component-with-impl}} -{{test-component-without-impl}} \ No newline at end of file + +{{test-component-without-impl}} + +{{nesting-level/test-component-with-impl}} + +{{nesting-level/test-component-without-impl}} \ No newline at end of file From 2dcea1598c82dbe3f4b5cb330c360144abb808d0 Mon Sep 17 00:00:00 2001 From: Marco Otte-Witte Date: Fri, 25 Nov 2016 16:55:51 +0100 Subject: [PATCH 4/5] improve code that generates component name --- .../add-test-selectors-to-components.js | 13 ++++++++++--- app/initializers/ember-test-selectors.js | 3 ++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/addon/initializers/add-test-selectors-to-components.js b/addon/initializers/add-test-selectors-to-components.js index 28acf4b2..d9635c34 100644 --- a/addon/initializers/add-test-selectors-to-components.js +++ b/addon/initializers/add-test-selectors-to-components.js @@ -1,9 +1,16 @@ import Ember from 'ember'; const { getPrototypeOf } = Object; -const { computed, Component } = Ember; +const { computed, Component, get } = Ember; -export default function addTestSelectorsToComponents() { +const nameOfComponent = function nameOfComponent(component, config) { + let templateName = component._renderNode.lastResult.template.meta.moduleName; + templateName = templateName.replace(/\.hbs$/, ''); + templateName = templateName.replace(new RegExp(`${config.modulePrefix}\/templates\/components\/`), ''); + return templateName; +} + +export default function addTestSelectorsToComponents(config) { Component.reopen({ init() { let attributeBinding = `-data-test-component-selector:data-test-component`; @@ -13,7 +20,7 @@ export default function addTestSelectorsToComponents() { }, '-data-test-component-selector': computed(function() { - return getPrototypeOf(this)._debugContainerKey.replace(/^component:/, ''); + return nameOfComponent(this, config); }) }); } diff --git a/app/initializers/ember-test-selectors.js b/app/initializers/ember-test-selectors.js index 7a426565..9c7a44bb 100644 --- a/app/initializers/ember-test-selectors.js +++ b/app/initializers/ember-test-selectors.js @@ -1,8 +1,9 @@ import addTestSelectorsToComponents from 'ember-test-selectors/initializers/add-test-selectors-to-components'; +import config from '../config/environment'; export default { name: 'ember-test-selectors', initialize: function() { - addTestSelectorsToComponents(); + addTestSelectorsToComponents(config); } }; From 17225c6460e87dd6ac25a27cc3ad6d6b360e2515 Mon Sep 17 00:00:00 2001 From: Marco Otte-Witte Date: Mon, 28 Nov 2016 14:17:25 +0100 Subject: [PATCH 5/5] automatically bind all data-test- attributes --- .../add-test-selectors-to-components.js | 33 +++++++++---------- .../data-test-attributes-binding-test.js | 14 ++++++++ .../nesting-level/test-component-with-impl.js | 3 -- .../components/test-component-with-impl.js | 3 -- tests/dummy/app/components/test-component.js | 9 +++++ .../test-component-with-impl.hbs | 11 ------- .../test-component-without-impl.hbs | 11 ------- .../test-component-without-impl.hbs | 11 ------- ...onent-with-impl.hbs => test-component.hbs} | 0 tests/dummy/app/templates/index.hbs | 8 +---- .../strip-data-test-attributes-test.js | 4 +-- 11 files changed, 42 insertions(+), 65 deletions(-) create mode 100644 tests/acceptance/data-test-attributes-binding-test.js delete mode 100644 tests/dummy/app/components/nesting-level/test-component-with-impl.js delete mode 100644 tests/dummy/app/components/test-component-with-impl.js create mode 100644 tests/dummy/app/components/test-component.js delete mode 100644 tests/dummy/app/templates/components/nesting-level/test-component-with-impl.hbs delete mode 100644 tests/dummy/app/templates/components/nesting-level/test-component-without-impl.hbs delete mode 100644 tests/dummy/app/templates/components/test-component-without-impl.hbs rename tests/dummy/app/templates/components/{test-component-with-impl.hbs => test-component.hbs} (100%) diff --git a/addon/initializers/add-test-selectors-to-components.js b/addon/initializers/add-test-selectors-to-components.js index d9635c34..acb79ac0 100644 --- a/addon/initializers/add-test-selectors-to-components.js +++ b/addon/initializers/add-test-selectors-to-components.js @@ -1,26 +1,25 @@ import Ember from 'ember'; -const { getPrototypeOf } = Object; -const { computed, Component, get } = Ember; +const { Component } = Ember; -const nameOfComponent = function nameOfComponent(component, config) { - let templateName = component._renderNode.lastResult.template.meta.moduleName; - templateName = templateName.replace(/\.hbs$/, ''); - templateName = templateName.replace(new RegExp(`${config.modulePrefix}\/templates\/components\/`), ''); - return templateName; -} +const bindDataTestAttributes = function bindDataTestAttributes(component) { + let dataTestAttributes = []; + for (let attr in component) { + if (attr.indexOf('data-test-') === 0) { + dataTestAttributes.push(attr); + } + } + + let attributeBindings = component.getWithDefault('attributeBindings', []); + component.set('attributeBindings', attributeBindings.concat(dataTestAttributes)); +}; -export default function addTestSelectorsToComponents(config) { +export default function addTestSelectorsToComponents() { Component.reopen({ init() { - let attributeBinding = `-data-test-component-selector:data-test-component`; - this.attributeBindings = (this.attributeBindings || []).concat([attributeBinding]); - - return this._super(...arguments); - }, + bindDataTestAttributes(this); - '-data-test-component-selector': computed(function() { - return nameOfComponent(this, config); - }) + this._super(...arguments); + } }); } diff --git a/tests/acceptance/data-test-attributes-binding-test.js b/tests/acceptance/data-test-attributes-binding-test.js new file mode 100644 index 00000000..e1621095 --- /dev/null +++ b/tests/acceptance/data-test-attributes-binding-test.js @@ -0,0 +1,14 @@ +import { test } from 'qunit'; +import moduleForAcceptance from '../../tests/helpers/module-for-acceptance'; +import testSelector from 'dummy/tests/helpers/ember-test-selectors'; + +moduleForAcceptance('Acceptance | test'); + +test('it automatically binds all "data-test-*" attributes', function(assert) { + visit('/'); + + andThen(function() { + assert.equal(find(testSelector('predefined-attribute', 'test-value')).length, 1); + assert.equal(find(testSelector('on-the-fly-attribute')).length, 1); + }); +}); diff --git a/tests/dummy/app/components/nesting-level/test-component-with-impl.js b/tests/dummy/app/components/nesting-level/test-component-with-impl.js deleted file mode 100644 index a3e1d832..00000000 --- a/tests/dummy/app/components/nesting-level/test-component-with-impl.js +++ /dev/null @@ -1,3 +0,0 @@ -import Ember from 'ember'; - -export default Ember.Component.extend(); diff --git a/tests/dummy/app/components/test-component-with-impl.js b/tests/dummy/app/components/test-component-with-impl.js deleted file mode 100644 index a3e1d832..00000000 --- a/tests/dummy/app/components/test-component-with-impl.js +++ /dev/null @@ -1,3 +0,0 @@ -import Ember from 'ember'; - -export default Ember.Component.extend(); diff --git a/tests/dummy/app/components/test-component.js b/tests/dummy/app/components/test-component.js new file mode 100644 index 00000000..14381950 --- /dev/null +++ b/tests/dummy/app/components/test-component.js @@ -0,0 +1,9 @@ +import Ember from 'ember'; + +const { computed } = Ember; + +export default Ember.Component.extend({ + 'data-test-predefined-attribute': computed(function() { + return 'test-value'; + }) +}); diff --git a/tests/dummy/app/templates/components/nesting-level/test-component-with-impl.hbs b/tests/dummy/app/templates/components/nesting-level/test-component-with-impl.hbs deleted file mode 100644 index c36a3202..00000000 --- a/tests/dummy/app/templates/components/nesting-level/test-component-with-impl.hbs +++ /dev/null @@ -1,11 +0,0 @@ -

Nested Test Component with implementation

- -
-

"Please disperse. Nothing to see here." - Frank Drebin

-
- -

- This component only exists so we can convenietly use - moduleForComponent for the tests which check that - data-test-* attributes are stripped. -

\ No newline at end of file diff --git a/tests/dummy/app/templates/components/nesting-level/test-component-without-impl.hbs b/tests/dummy/app/templates/components/nesting-level/test-component-without-impl.hbs deleted file mode 100644 index ec62ff1e..00000000 --- a/tests/dummy/app/templates/components/nesting-level/test-component-without-impl.hbs +++ /dev/null @@ -1,11 +0,0 @@ -

Nested Test Component without implementation

- -
-

"Please disperse. Nothing to see here." - Frank Drebin

-
- -

- This component only exists so we can convenietly use - moduleForComponent for the tests which check that - data-test-* attributes are stripped. -

\ No newline at end of file diff --git a/tests/dummy/app/templates/components/test-component-without-impl.hbs b/tests/dummy/app/templates/components/test-component-without-impl.hbs deleted file mode 100644 index 71b9c831..00000000 --- a/tests/dummy/app/templates/components/test-component-without-impl.hbs +++ /dev/null @@ -1,11 +0,0 @@ -

Test Component without implementation

- -
-

"Please disperse. Nothing to see here." - Frank Drebin

-
- -

- This component only exists so we can convenietly use - moduleForComponent for the tests which check that - data-test-* attributes are stripped. -

\ No newline at end of file diff --git a/tests/dummy/app/templates/components/test-component-with-impl.hbs b/tests/dummy/app/templates/components/test-component.hbs similarity index 100% rename from tests/dummy/app/templates/components/test-component-with-impl.hbs rename to tests/dummy/app/templates/components/test-component.hbs diff --git a/tests/dummy/app/templates/index.hbs b/tests/dummy/app/templates/index.hbs index f53678eb..c3a96266 100644 --- a/tests/dummy/app/templates/index.hbs +++ b/tests/dummy/app/templates/index.hbs @@ -1,7 +1 @@ -{{test-component-with-impl}} - -{{test-component-without-impl}} - -{{nesting-level/test-component-with-impl}} - -{{nesting-level/test-component-without-impl}} \ No newline at end of file +{{test-component data-test-on-the-fly-attribute=true}} \ No newline at end of file diff --git a/tests/integration/strip-data-test-attributes-test.js b/tests/integration/strip-data-test-attributes-test.js index 001d97bc..7e026030 100644 --- a/tests/integration/strip-data-test-attributes-test.js +++ b/tests/integration/strip-data-test-attributes-test.js @@ -1,5 +1,5 @@ -import { moduleForComponent, test } from "ember-qunit"; -import hbs from "htmlbars-inline-precompile"; +import { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; moduleForComponent('data-test', 'StripTestSelectorsTransform plugin', { integration: true