@@ -18,7 +18,7 @@ test('it renders', function(assert) {
18
18
19
19
this . render ( hbs `{{t-grid}}` ) ;
20
20
21
- assert . equal ( this . $ ( ) . text ( ) . trim ( ) , 'toggle grid' ) ;
21
+ assert . equal ( find ( 'button' ) . textContent . trim ( ) , 'toggle grid' ) ;
22
22
23
23
// Template block usage:
24
24
this . render ( hbs `
@@ -27,22 +27,23 @@ test('it renders', function(assert) {
27
27
{{/t-grid}}
28
28
` ) ;
29
29
30
- assert . equal ( this . $ ( ) . text ( ) . trim ( ) , 'toggle grid' ) ;
30
+ assert . equal ( find ( 'button' ) . textContent . trim ( ) , 'toggle grid' ) ;
31
31
} ) ;
32
32
33
33
test ( 'it creates a grid transformicon with defaults' , function ( assert ) {
34
- assert . expect ( 5 ) ;
34
+ assert . expect ( 6 ) ;
35
35
36
36
this . render ( hbs `{{t-grid}}` ) ;
37
37
percySnapshot ( assert ) ;
38
38
39
- let compButton = this . $ ( 'button' ) ;
39
+ let button = find ( 'button' ) ;
40
40
41
- assert . equal ( compButton . attr ( 'type' ) , 'button' ) ;
42
- assert . equal ( compButton . attr ( 'aria-label' ) , 'toggle grid' ) ;
43
- assert . ok ( compButton . hasClass ( 'tcon' ) ) ;
44
- assert . ok ( compButton . hasClass ( 'tcon-grid' ) ) ;
45
- assert . ok ( compButton . hasClass ( 'tcon-grid--rearrange' ) ) ;
41
+ assert . equal ( button . getAttribute ( 'type' ) , 'button' ) ;
42
+ assert . equal ( button . getAttribute ( 'aria-label' ) , 'toggle grid' ) ;
43
+ assert . ok ( button . classList . contains ( 'tcon' ) ) ;
44
+ assert . ok ( button . classList . contains ( 'tcon-grid' ) ) ;
45
+ assert . ok ( button . classList . contains ( 'tcon-grid--rearrange' ) ) ;
46
+ assert . notOk ( button . classList . contains ( 'tcon-transform' ) ) ;
46
47
} ) ;
47
48
48
49
test ( 'it creates a grid transformicon with `is-open=true`' , function ( assert ) {
@@ -51,31 +52,31 @@ test('it creates a grid transformicon with `is-open=true`', function(assert) {
51
52
this . render ( hbs `{{t-grid is-open=true}}` ) ;
52
53
percySnapshot ( assert ) ;
53
54
54
- let compButton = this . $ ( 'button' ) ;
55
+ let button = find ( 'button' ) ;
55
56
56
- assert . ok ( compButton . hasClass ( 'tcon-transform' ) ) ;
57
+ assert . ok ( button . classList . contains ( 'tcon-transform' ) ) ;
57
58
} ) ;
58
59
59
60
test ( 'it creates a grid transformicon with a non-default animation `a="collapse"`' , function ( assert ) {
60
61
assert . expect ( 1 ) ;
61
62
62
63
this . render ( hbs `{{t-grid a="collapse"}}` ) ;
63
64
64
- let compButton = this . $ ( 'button' ) ;
65
+ let button = find ( 'button' ) ;
65
66
66
- assert . ok ( compButton . hasClass ( 'tcon-grid--collapse' ) ) ;
67
+ assert . ok ( button . classList . contains ( 'tcon-grid--collapse' ) ) ;
67
68
} ) ;
68
69
69
70
test ( 'user can click on the transformicon' , function ( assert ) {
70
71
assert . expect ( 2 ) ;
71
72
72
73
this . render ( hbs `{{t-grid id="t-grid"}}` ) ;
73
74
74
- let elem = find ( '#t-grid' ) ;
75
- assert . equal ( this . $ ( elem ) . hasClass ( 'tcon-transform' ) , false ) ;
75
+ let button = find ( '#t-grid' ) ;
76
+ assert . equal ( button . classList . contains ( 'tcon-transform' ) , false ) ;
76
77
77
78
click ( '#t-grid' ) ;
78
79
percySnapshot ( assert ) ;
79
80
80
- assert . equal ( this . $ ( elem ) . hasClass ( 'tcon-transform' ) , true ) ;
81
+ assert . equal ( button . classList . contains ( 'tcon-transform' ) , true ) ;
81
82
} ) ;
0 commit comments