@@ -121,11 +121,15 @@ describe('PrimaryNavigationQuotaExceeded', function () {
121
121
// doesn't show categories with <=1 reserved tier and no PAYG
122
122
expect (
123
123
screen . getByText (
124
- / Y o u ’ v e r u n o u t o f e r r o r s , r e p l a y s , s p a n s , a n d c o n t i n u o u s p r o f i l e h o u r s f o r t h i s b i l l i n g c y c l e ./
124
+ / Y o u h a v e u s e d u p y o u r q u o t a f o r e r r o r s , r e p l a y s , s p a n s , a n d c o n t i n u o u s p r o f i l e h o u r s . M o n i t o r i n g a n d n e w d a t a f o r t h e s e f e a t u r e s a r e p a u s e d u n t i l y o u r q u o t a r e s e t s ./
125
125
)
126
126
) . toBeInTheDocument ( ) ;
127
127
expect ( screen . queryByText ( / c r o n m o n i t o r s / ) ) . not . toBeInTheDocument ( ) ;
128
- expect ( screen . getByRole ( 'checkbox' ) ) . not . toBeChecked ( ) ;
128
+ expect (
129
+ screen . getByRole ( 'button' , {
130
+ name : 'Dismiss alert for the rest of the billing cycle' ,
131
+ } )
132
+ ) . toBeInTheDocument ( ) ;
129
133
} ) ;
130
134
131
135
it ( 'should render for single category' , async function ( ) {
@@ -147,9 +151,15 @@ describe('PrimaryNavigationQuotaExceeded', function () {
147
151
148
152
expect ( await screen . findByText ( 'Error Quota Exceeded' ) ) . toBeInTheDocument ( ) ;
149
153
expect (
150
- screen . getByText ( / Y o u ’ v e r u n o u t o f e r r o r s f o r t h i s b i l l i n g c y c l e ./ )
154
+ screen . getByText (
155
+ / Y o u h a v e u s e d u p y o u r q u o t a f o r e r r o r s . M o n i t o r i n g a n d n e w d a t a a r e p a u s e d u n t i l y o u r q u o t a r e s e t s ./
156
+ )
151
157
) . toBeInTheDocument ( ) ; // doesn't show categories with <=1 reserved tier and no PAYG
152
- expect ( screen . getByRole ( 'checkbox' ) ) . not . toBeChecked ( ) ;
158
+ expect (
159
+ screen . getByRole ( 'button' , {
160
+ name : 'Dismiss alert for the rest of the billing cycle' ,
161
+ } )
162
+ ) . toBeInTheDocument ( ) ;
153
163
} ) ;
154
164
155
165
it ( 'should not render for zero categories' , function ( ) {
@@ -183,10 +193,17 @@ describe('PrimaryNavigationQuotaExceeded', function () {
183
193
expect ( await screen . findByText ( 'Quotas Exceeded' ) ) . toBeInTheDocument ( ) ;
184
194
expect (
185
195
screen . getByText (
186
- / Y o u ’ v e r u n o u t o f e r r o r s , r e p l a y s , s p a n s , c r o n m o n i t o r s , a n d c o n t i n u o u s p r o f i l e h o u r s f o r t h i s b i l l i n g c y c l e ./
196
+ / Y o u h a v e u s e d u p y o u r q u o t a f o r e r r o r s , r e p l a y s , s p a n s , a n d c o n t i n u o u s p r o f i l e h o u r s ./
187
197
)
188
198
) . toBeInTheDocument ( ) ;
189
- expect ( screen . getByRole ( 'checkbox' ) ) . not . toBeChecked ( ) ;
199
+ expect (
200
+ screen . getByText ( / Y o u h a v e a l s o r e a c h e d y o u r q u o t a f o r c r o n m o n i t o r s ./ )
201
+ ) . toBeInTheDocument ( ) ;
202
+ expect (
203
+ screen . getByRole ( 'button' , {
204
+ name : 'Dismiss alert for the rest of the billing cycle' ,
205
+ } )
206
+ ) . toBeInTheDocument ( ) ;
190
207
191
208
// reset
192
209
subscription . onDemandMaxSpend = 0 ;
@@ -213,10 +230,17 @@ describe('PrimaryNavigationQuotaExceeded', function () {
213
230
expect ( await screen . findByText ( 'Quotas Exceeded' ) ) . toBeInTheDocument ( ) ;
214
231
expect (
215
232
screen . getByText (
216
- / Y o u ’ v e r u n o u t o f e r r o r s , r e p l a y s , s p a n s , c r o n m o n i t o r s , a n d c o n t i n u o u s p r o f i l e h o u r s f o r t h i s b i l l i n g c y c l e ./
233
+ / Y o u h a v e u s e d u p y o u r q u o t a f o r e r r o r s , r e p l a y s , s p a n s , a n d c o n t i n u o u s p r o f i l e h o u r s ./
217
234
)
218
235
) . toBeInTheDocument ( ) ;
219
- expect ( screen . getByRole ( 'checkbox' ) ) . not . toBeChecked ( ) ;
236
+ expect (
237
+ screen . getByText ( / Y o u h a v e a l s o r e a c h e d y o u r q u o t a f o r c r o n m o n i t o r s ./ )
238
+ ) . toBeInTheDocument ( ) ;
239
+ expect (
240
+ screen . getByRole ( 'button' , {
241
+ name : 'Dismiss alert for the rest of the billing cycle' ,
242
+ } )
243
+ ) . toBeInTheDocument ( ) ;
220
244
221
245
// reset
222
246
subscription . onDemandMaxSpend = 0 ;
@@ -236,15 +260,19 @@ describe('PrimaryNavigationQuotaExceeded', function () {
236
260
subscription . canSelfServe = true ;
237
261
} ) ;
238
262
239
- it ( 'should update prompts when checkbox is toggled ' , async function ( ) {
263
+ it ( 'should update prompts when dismissed ' , async function ( ) {
240
264
render ( < PrimaryNavigationQuotaExceeded organization = { organization } /> ) ;
241
265
242
266
// open the alert
243
267
await userEvent . click ( await screen . findByRole ( 'button' , { name : 'Billing Status' } ) ) ;
244
268
expect ( await screen . findByText ( 'Quotas Exceeded' ) ) . toBeInTheDocument ( ) ;
245
269
246
270
// stop the alert from animating
247
- await userEvent . click ( screen . getByRole ( 'checkbox' ) ) ;
271
+ await userEvent . click (
272
+ screen . getByRole ( 'button' , {
273
+ name : 'Dismiss alert for the rest of the billing cycle' ,
274
+ } )
275
+ ) ;
248
276
expect ( promptMock ) . toHaveBeenCalledTimes ( 4 ) ; // one for each category
249
277
} ) ;
250
278
0 commit comments