@@ -7,11 +7,6 @@ import { render, click, find, settled, waitFor } from '@ember/test-helpers';
7
7
module ( 'Integration | Component | isShown' , function ( hooks ) {
8
8
setupRenderingTest ( hooks ) ;
9
9
10
- hooks . beforeEach ( function ( ) {
11
- this . actions = { } ;
12
- this . send = ( actionName , ...args ) => this . actions [ actionName ] . apply ( this , args ) ;
13
- } ) ;
14
-
15
10
test ( 'isShown works with showOn/hideOn set to "click"' , async function ( assert ) {
16
11
assert . expect ( 3 ) ;
17
12
@@ -44,11 +39,11 @@ module('Integration | Component | isShown', function(hooks) {
44
39
test ( 'isShown works with showOn/hideOn set to `null`' , async function ( assert ) {
45
40
assert . expect ( 3 ) ;
46
41
47
- this . actions . closePopover = ( ) => {
42
+ this . closePopover = ( ) => {
48
43
this . set ( 'isShown' , false ) ;
49
44
} ;
50
45
51
- this . actions . openPopover = ( ) => {
46
+ this . openPopover = ( ) => {
52
47
this . set ( 'isShown' , true ) ;
53
48
} ;
54
49
@@ -58,7 +53,7 @@ module('Integration | Component | isShown', function(hooks) {
58
53
this . set ( 'showOn' , null ) ;
59
54
60
55
await render ( hbs `
61
- <button id="open" {{action 'openPopover' }}>
56
+ <button id="open" {{on 'click' this.openPopover }}>
62
57
Click me, captain!
63
58
64
59
{{#attach-popover id='attachment'
@@ -67,7 +62,7 @@ module('Integration | Component | isShown', function(hooks) {
67
62
showOn=this.showOn}}
68
63
isShown w/ hideOn/ShowOn of 'none'
69
64
70
- <button id="close" {{action 'closePopover' }}>
65
+ <button id="close" {{on 'click' this.closePopover }}>
71
66
Close
72
67
</button>
73
68
@@ -91,11 +86,11 @@ module('Integration | Component | isShown', function(hooks) {
91
86
test ( 'isShown works with showOn/hideOn set to `null` with lazyRender' , async function ( assert ) {
92
87
assert . expect ( 3 ) ;
93
88
94
- this . actions . closePopover = ( ) => {
89
+ this . closePopover = ( ) => {
95
90
this . set ( 'isShown' , false ) ;
96
91
} ;
97
92
98
- this . actions . openPopover = ( ) => {
93
+ this . openPopover = ( ) => {
99
94
this . set ( 'isShown' , true ) ;
100
95
} ;
101
96
@@ -105,7 +100,7 @@ module('Integration | Component | isShown', function(hooks) {
105
100
this . set ( 'showOn' , null ) ;
106
101
107
102
await render ( hbs `
108
- <button id="open" {{action 'openPopover' }}>
103
+ <button id="open" {{on 'click' this.openPopover }}>
109
104
Click me, captain!
110
105
111
106
{{#attach-popover id='attachment'
@@ -115,7 +110,7 @@ module('Integration | Component | isShown', function(hooks) {
115
110
showOn=this.showOn}}
116
111
isShown w/ hideOn/ShowOn of 'none'
117
112
118
- <button id="close" {{action 'closePopover' }}>
113
+ <button id="close" {{on 'click' this.closePopover }}>
119
114
Close
120
115
</button>
121
116
@@ -141,15 +136,15 @@ module('Integration | Component | isShown', function(hooks) {
141
136
test ( 'nested attachers open and close as expected' , async function ( assert ) {
142
137
assert . expect ( 7 ) ;
143
138
144
- this . actions . openParentPopover = ( ) => {
139
+ this . openParentPopover = ( ) => {
145
140
this . set ( 'parentIsShown' , true ) ;
146
141
} ;
147
142
148
- this . actions . closeChildPopover = ( ) => {
143
+ this . closeChildPopover = ( ) => {
149
144
this . set ( 'childIsShown' , false ) ;
150
145
} ;
151
146
152
- this . actions . openChildPopover = ( ) => {
147
+ this . openChildPopover = ( ) => {
153
148
this . set ( 'childIsShown' , true ) ;
154
149
} ;
155
150
@@ -162,23 +157,23 @@ module('Integration | Component | isShown', function(hooks) {
162
157
} ) ;
163
158
164
159
await render ( hbs `
165
- <button id="openParent" {{action 'openParentPopover' }}>
160
+ <button id="openParent" {{on 'click' this.openParentPopover }}>
166
161
Open parent
167
162
168
163
{{#attach-popover hideOn=this.hideOn
169
164
id='parent'
170
165
isShown=this.parentIsShown
171
166
showOn=this.showOn
172
167
interactive=true}}
173
- <button id="openChild" {{action 'openChildPopover' }}>
168
+ <button id="openChild" {{on 'click' this.openChildPopover }}>
174
169
Open child
175
170
176
171
{{#attach-popover hideDuration=0
177
172
hideOn='none'
178
173
id='child'
179
174
isShown=this.childIsShown
180
175
showOn='none'}}
181
- <button id="closeChild" {{action 'closeChildPopover' }}>
176
+ <button id="closeChild" {{on 'click' this.closeChildPopover }}>
182
177
Close child
183
178
</button>
184
179
{{/attach-popover}}
0 commit comments