4
4
*/
5
5
6
6
import { module , test } from 'qunit' ;
7
- import { visit , currentURL , click , findAll } from '@ember/test-helpers' ;
7
+ import { visit , currentURL , click } from '@ember/test-helpers' ;
8
8
import { setupApplicationTest } from 'admin/tests/helpers' ;
9
9
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage' ;
10
10
import { setupIndexedDb } from 'api/test-support/helpers/indexed-db' ;
@@ -61,21 +61,18 @@ module('Acceptance | groups | members', function (hooks) {
61
61
await a11yAudit ( ) ;
62
62
63
63
assert . strictEqual ( currentURL ( ) , urls . members ) ;
64
- assert . strictEqual ( findAll ( commonSelectors . TABLE_ROW ) . length , membersCount ) ;
64
+ assert . dom ( commonSelectors . TABLE_ROW ) . exists ( { count : membersCount } ) ;
65
65
} ) ;
66
66
67
67
test ( 'can remove a member' , async function ( assert ) {
68
68
await visit ( urls . members ) ;
69
69
70
- assert . strictEqual ( findAll ( commonSelectors . TABLE_ROW ) . length , membersCount ) ;
70
+ assert . dom ( commonSelectors . TABLE_ROW ) . exists ( { count : membersCount } ) ;
71
71
72
72
await click ( selectors . TABLE_MEMBER_ACTION_DROPDOWN ) ;
73
- await click ( selectors . TABLE_ACTION_DROPDOWN_DELETE_MEMBER ) ;
73
+ await click ( selectors . TABLE_MEMBER_ACTION_DROPDOWN_DELETE_MEMBER ) ;
74
74
75
- assert . strictEqual (
76
- findAll ( commonSelectors . TABLE_ROW ) . length ,
77
- membersCount - 1 ,
78
- ) ;
75
+ assert . dom ( commonSelectors . TABLE_ROW ) . exists ( { count : membersCount - 1 } ) ;
79
76
} ) ;
80
77
81
78
test ( 'cannot remove a member without proper authorization' , async function ( assert ) {
@@ -85,7 +82,9 @@ module('Acceptance | groups | members', function (hooks) {
85
82
instances . group . update ( { authorized_actions } ) ;
86
83
await visit ( urls . members ) ;
87
84
88
- assert . dom ( selectors . TABLE_ACTION_DROPDOWN_DELETE_MEMBER ) . doesNotExist ( ) ;
85
+ assert
86
+ . dom ( selectors . TABLE_MEMBER_ACTION_DROPDOWN_DELETE_MEMBER )
87
+ . doesNotExist ( ) ;
89
88
} ) ;
90
89
91
90
test ( 'shows error message on member remove' , async function ( assert ) {
@@ -103,11 +102,10 @@ module('Acceptance | groups | members', function (hooks) {
103
102
) ;
104
103
} ) ;
105
104
await visit ( urls . members ) ;
106
-
107
- assert . strictEqual ( findAll ( commonSelectors . TABLE_ROW ) . length , membersCount ) ;
105
+ assert . dom ( commonSelectors . TABLE_ROW ) . exists ( { count : membersCount } ) ;
108
106
109
107
await click ( selectors . TABLE_MEMBER_ACTION_DROPDOWN ) ;
110
- await click ( selectors . TABLE_ACTION_DROPDOWN_DELETE_MEMBER ) ;
108
+ await click ( selectors . TABLE_MEMBER_ACTION_DROPDOWN_DELETE_MEMBER ) ;
111
109
112
110
assert . dom ( commonSelectors . ALERT_TOAST_BODY ) . hasText ( errorMsg ) ;
113
111
} ) ;
@@ -139,7 +137,7 @@ module('Acceptance | groups | members', function (hooks) {
139
137
instances . group . update ( { memberIds : [ ] } ) ;
140
138
await visit ( urls . members ) ;
141
139
142
- assert . strictEqual ( findAll ( commonSelectors . TABLE_ROW ) . length , 0 ) ;
140
+ assert . dom ( commonSelectors . TABLE_ROW ) . exists ( { count : 0 } ) ;
143
141
144
142
await click ( selectors . MANAGE_DROPDOWN ) ;
145
143
await click ( selectors . MANAGE_DROPDOWN_ADD_MEMBER ) ;
@@ -151,21 +149,18 @@ module('Acceptance | groups | members', function (hooks) {
151
149
152
150
await visit ( urls . members ) ;
153
151
154
- assert . strictEqual ( findAll ( commonSelectors . TABLE_ROW ) . length , 1 ) ;
152
+ assert . dom ( commonSelectors . TABLE_ROW ) . exists ( { count : 1 } ) ;
155
153
} ) ;
156
154
157
155
test ( 'select and cancel members to add' , async function ( assert ) {
158
156
await visit ( urls . members ) ;
159
157
160
- assert . strictEqual ( findAll ( commonSelectors . TABLE_ROW ) . length , membersCount ) ;
158
+ assert . dom ( commonSelectors . TABLE_ROW ) . exists ( { count : membersCount } ) ;
161
159
162
160
await click ( selectors . TABLE_MEMBER_ACTION_DROPDOWN ) ;
163
- await click ( selectors . TABLE_ACTION_DROPDOWN_DELETE_MEMBER ) ;
161
+ await click ( selectors . TABLE_MEMBER_ACTION_DROPDOWN_DELETE_MEMBER ) ;
164
162
165
- assert . strictEqual (
166
- findAll ( commonSelectors . TABLE_ROW ) . length ,
167
- membersCount - 1 ,
168
- ) ;
163
+ assert . dom ( commonSelectors . TABLE_ROW ) . exists ( { count : membersCount - 1 } ) ;
169
164
170
165
await click ( selectors . MANAGE_DROPDOWN ) ;
171
166
await click ( selectors . MANAGE_DROPDOWN_ADD_MEMBER ) ;
@@ -177,10 +172,7 @@ module('Acceptance | groups | members', function (hooks) {
177
172
await click ( commonSelectors . CANCEL_BTN ) ;
178
173
179
174
assert . strictEqual ( currentURL ( ) , urls . members ) ;
180
- assert . strictEqual (
181
- findAll ( commonSelectors . TABLE_ROW ) . length ,
182
- membersCount - 1 ,
183
- ) ;
175
+ assert . dom ( commonSelectors . TABLE_ROW ) . exists ( { count : membersCount - 1 } ) ;
184
176
} ) ;
185
177
186
178
test ( 'shows error message on member add' , async function ( assert ) {
0 commit comments