@@ -6,20 +6,17 @@ import { InteractiveRenderer } from 'ember-metal-views';
66import { equalInnerHTML } from 'htmlbars-test-helpers' ;
77import { domHelper as dom } from 'ember-htmlbars/env' ;
88import { runAppend , runDestroy } from 'ember-runtime/tests/utils' ;
9+ import { test , testModule } from 'ember-glimmer/tests/utils/skip-if-glimmer' ;
910
1011var view , originalSetAttribute , setAttributeCalls , renderer ;
1112
12- import isEnabled from 'ember-metal/features' ;
13- if ( ! isEnabled ( 'ember-glimmer' ) ) {
14- // jscs:disable
15-
16- QUnit . module ( 'ember-htmlbars: data attribute' , {
13+ testModule ( 'ember-htmlbars: data attribute' , {
1714 teardown ( ) {
1815 runDestroy ( view ) ;
1916 }
2017} ) ;
2118
22- QUnit . test ( 'property is output' , function ( ) {
19+ test ( 'property is output' , function ( ) {
2320 view = EmberView . create ( {
2421 context : { name : 'erik' } ,
2522 template : compile ( '<div data-name={{name}}>Hi!</div>' )
@@ -29,7 +26,7 @@ QUnit.test('property is output', function() {
2926 equalInnerHTML ( view . element , '<div data-name="erik">Hi!</div>' , 'attribute is output' ) ;
3027} ) ;
3128
32- QUnit . test ( 'property set before didInsertElement' , function ( ) {
29+ test ( 'property set before didInsertElement' , function ( ) {
3330 var matchingElement ;
3431 view = EmberView . create ( {
3532 didInsertElement ( ) {
@@ -44,7 +41,7 @@ QUnit.test('property set before didInsertElement', function() {
4441 equal ( matchingElement . length , 1 , 'element is in the DOM when didInsertElement' ) ;
4542} ) ;
4643
47- QUnit . test ( 'quoted attributes are concatenated' , function ( ) {
44+ test ( 'quoted attributes are concatenated' , function ( ) {
4845 view = EmberView . create ( {
4946 context : { firstName : 'max' , lastName : 'jackson' } ,
5047 template : compile ( '<div data-name=\'{{firstName}} {{lastName}}\'>Hi!</div>' )
@@ -54,7 +51,7 @@ QUnit.test('quoted attributes are concatenated', function() {
5451 equalInnerHTML ( view . element , '<div data-name="max jackson">Hi!</div>' , 'attribute is output' ) ;
5552} ) ;
5653
57- QUnit . test ( 'quoted attributes are updated when changed' , function ( ) {
54+ test ( 'quoted attributes are updated when changed' , function ( ) {
5855 view = EmberView . create ( {
5956 context : { firstName : 'max' , lastName : 'jackson' } ,
6057 template : compile ( '<div data-name=\'{{firstName}} {{lastName}}\'>Hi!</div>' )
@@ -68,7 +65,7 @@ QUnit.test('quoted attributes are updated when changed', function() {
6865 equalInnerHTML ( view . element , '<div data-name="james jackson">Hi!</div>' , 'attribute is output' ) ;
6966} ) ;
7067
71- QUnit . test ( 'quoted attributes are not removed when value is null' , function ( ) {
68+ test ( 'quoted attributes are not removed when value is null' , function ( ) {
7269 view = EmberView . create ( {
7370 context : { firstName : 'max' , lastName : 'jackson' } ,
7471 template : compile ( '<div data-name=\'{{firstName}}\'>Hi!</div>' )
@@ -82,7 +79,7 @@ QUnit.test('quoted attributes are not removed when value is null', function() {
8279 equal ( view . element . firstChild . getAttribute ( 'data-name' ) , '' , 'attribute is output' ) ;
8380} ) ;
8481
85- QUnit . test ( 'unquoted attributes are removed when value is null' , function ( ) {
82+ test ( 'unquoted attributes are removed when value is null' , function ( ) {
8683 view = EmberView . create ( {
8784 context : { firstName : 'max' } ,
8885 template : compile ( '<div data-name={{firstName}}>Hi!</div>' )
@@ -96,7 +93,7 @@ QUnit.test('unquoted attributes are removed when value is null', function() {
9693 ok ( ! view . element . firstChild . hasAttribute ( 'data-name' ) , 'attribute is removed output' ) ;
9794} ) ;
9895
99- QUnit . test ( 'unquoted attributes that are null are not added' , function ( ) {
96+ test ( 'unquoted attributes that are null are not added' , function ( ) {
10097 view = EmberView . create ( {
10198 context : { firstName : null } ,
10299 template : compile ( '<div data-name={{firstName}}>Hi!</div>' )
@@ -106,7 +103,7 @@ QUnit.test('unquoted attributes that are null are not added', function() {
106103 equalInnerHTML ( view . element , '<div>Hi!</div>' , 'attribute is not present' ) ;
107104} ) ;
108105
109- QUnit . test ( 'unquoted attributes are added when changing from null' , function ( ) {
106+ test ( 'unquoted attributes are added when changing from null' , function ( ) {
110107 view = EmberView . create ( {
111108 context : { firstName : null } ,
112109 template : compile ( '<div data-name={{firstName}}>Hi!</div>' )
@@ -120,7 +117,7 @@ QUnit.test('unquoted attributes are added when changing from null', function() {
120117 equalInnerHTML ( view . element , '<div data-name="max">Hi!</div>' , 'attribute is added output' ) ;
121118} ) ;
122119
123- QUnit . test ( 'property value is directly added to attribute' , function ( ) {
120+ test ( 'property value is directly added to attribute' , function ( ) {
124121 view = EmberView . create ( {
125122 context : { name : '"" data-foo="blah"' } ,
126123 template : compile ( '<div data-name={{name}}>Hi!</div>' )
@@ -130,7 +127,7 @@ QUnit.test('property value is directly added to attribute', function() {
130127 equal ( view . element . firstChild . getAttribute ( 'data-name' ) , '"" data-foo="blah"' , 'attribute is output' ) ;
131128} ) ;
132129
133- QUnit . test ( 'path is output' , function ( ) {
130+ test ( 'path is output' , function ( ) {
134131 view = EmberView . create ( {
135132 context : { name : { firstName : 'erik' } } ,
136133 template : compile ( '<div data-name={{name.firstName}}>Hi!</div>' )
@@ -140,7 +137,7 @@ QUnit.test('path is output', function() {
140137 equalInnerHTML ( view . element , '<div data-name="erik">Hi!</div>' , 'attribute is output' ) ;
141138} ) ;
142139
143- QUnit . test ( 'changed property updates' , function ( ) {
140+ test ( 'changed property updates' , function ( ) {
144141 var context = EmberObject . create ( { name : 'erik' } ) ;
145142 view = EmberView . create ( {
146143 context : context ,
@@ -155,7 +152,7 @@ QUnit.test('changed property updates', function() {
155152 equalInnerHTML ( view . element , '<div data-name="mmun">Hi!</div>' , 'attribute is updated output' ) ;
156153} ) ;
157154
158- QUnit . test ( 'updates are scheduled in the render queue' , function ( ) {
155+ test ( 'updates are scheduled in the render queue' , function ( ) {
159156 expect ( 4 ) ;
160157
161158 var context = EmberObject . create ( { name : 'erik' } ) ;
@@ -182,7 +179,7 @@ QUnit.test('updates are scheduled in the render queue', function() {
182179 equalInnerHTML ( view . element , '<div data-name="mmun">Hi!</div>' , 'attribute is updated output' ) ;
183180} ) ;
184181
185- QUnit . test ( 'updates fail silently after an element is destroyed' , function ( ) {
182+ test ( 'updates fail silently after an element is destroyed' , function ( ) {
186183 var context = EmberObject . create ( { name : 'erik' } ) ;
187184 view = EmberView . create ( {
188185 context : context ,
@@ -198,7 +195,7 @@ QUnit.test('updates fail silently after an element is destroyed', function() {
198195 } ) ;
199196} ) ;
200197
201- QUnit . module ( 'ember-htmlbars: {{attribute}} helper -- setAttribute' , {
198+ testModule ( 'ember-htmlbars: {{attribute}} helper -- setAttribute' , {
202199 setup ( ) {
203200 renderer = InteractiveRenderer . create ( { dom } ) ;
204201
@@ -221,7 +218,7 @@ QUnit.module('ember-htmlbars: {{attribute}} helper -- setAttribute', {
221218 }
222219} ) ;
223220
224- QUnit . test ( 'calls setAttribute for new values' , function ( ) {
221+ test ( 'calls setAttribute for new values' , function ( ) {
225222 var context = EmberObject . create ( { name : 'erik' } ) ;
226223 view = EmberView . create ( {
227224 renderer : renderer ,
@@ -240,7 +237,7 @@ QUnit.test('calls setAttribute for new values', function() {
240237 deepEqual ( setAttributeCalls , expected ) ;
241238} ) ;
242239
243- QUnit . test ( 'does not call setAttribute if the same value is set' , function ( ) {
240+ test ( 'does not call setAttribute if the same value is set' , function ( ) {
244241 var context = EmberObject . create ( { name : 'erik' } ) ;
245242 view = EmberView . create ( {
246243 renderer : renderer ,
@@ -260,5 +257,3 @@ QUnit.test('does not call setAttribute if the same value is set', function() {
260257
261258 deepEqual ( setAttributeCalls , expected ) ;
262259} ) ;
263-
264- }
0 commit comments