@@ -26,6 +26,7 @@ describe('Discover > QueryList', function () {
26
26
let duplicateMock : jest . Mock ;
27
27
let updateHomepageMock : jest . Mock ;
28
28
let eventsStatsMock : jest . Mock ;
29
+ const refetchSavedQueries = jest . fn ( ) ;
29
30
30
31
const { router} = initializeOrg ( ) ;
31
32
@@ -34,6 +35,7 @@ describe('Discover > QueryList', function () {
34
35
} ) ;
35
36
36
37
beforeEach ( function ( ) {
38
+ jest . resetAllMocks ( ) ;
37
39
organization = OrganizationFixture ( {
38
40
features : [ 'discover-basic' , 'discover-query' ] ,
39
41
} ) ;
@@ -91,6 +93,7 @@ describe('Discover > QueryList', function () {
91
93
pageLinks = ""
92
94
renderPrebuilt = { false }
93
95
location = { location }
96
+ refetchSavedQueries = { refetchSavedQueries }
94
97
/> ,
95
98
{
96
99
deprecatedRouterMocks : true ,
@@ -110,6 +113,7 @@ describe('Discover > QueryList', function () {
110
113
renderPrebuilt
111
114
pageLinks = ""
112
115
location = { location }
116
+ refetchSavedQueries = { refetchSavedQueries }
113
117
/> ,
114
118
{
115
119
deprecatedRouterMocks : true ,
@@ -151,6 +155,7 @@ describe('Discover > QueryList', function () {
151
155
renderPrebuilt
152
156
pageLinks = ""
153
157
location = { location }
158
+ refetchSavedQueries = { refetchSavedQueries }
154
159
/> ,
155
160
{
156
161
router,
@@ -210,6 +215,7 @@ describe('Discover > QueryList', function () {
210
215
renderPrebuilt
211
216
pageLinks = ""
212
217
location = { location }
218
+ refetchSavedQueries = { refetchSavedQueries }
213
219
/> ,
214
220
{
215
221
deprecatedRouterMocks : true ,
@@ -248,6 +254,7 @@ describe('Discover > QueryList', function () {
248
254
pageLinks = ""
249
255
renderPrebuilt = { false }
250
256
location = { location }
257
+ refetchSavedQueries = { refetchSavedQueries }
251
258
/> ,
252
259
{
253
260
router,
@@ -282,6 +289,7 @@ describe('Discover > QueryList', function () {
282
289
savedQueries = { savedQueries }
283
290
pageLinks = ""
284
291
location = { location }
292
+ refetchSavedQueries = { refetchSavedQueries }
285
293
/> ,
286
294
{
287
295
deprecatedRouterMocks : true ,
@@ -295,6 +303,7 @@ describe('Discover > QueryList', function () {
295
303
await userEvent . click ( withinCard . getByText ( 'Delete Query' ) ) ;
296
304
297
305
expect ( deleteMock ) . toHaveBeenCalled ( ) ;
306
+ expect ( refetchSavedQueries ) . toHaveBeenCalled ( ) ;
298
307
} ) ;
299
308
300
309
it ( 'redirects to Discover on card click' , async function ( ) {
@@ -307,6 +316,7 @@ describe('Discover > QueryList', function () {
307
316
pageLinks = ""
308
317
renderPrebuilt = { false }
309
318
location = { location }
319
+ refetchSavedQueries = { refetchSavedQueries }
310
320
/> ,
311
321
{
312
322
router,
@@ -331,6 +341,7 @@ describe('Discover > QueryList', function () {
331
341
renderPrebuilt = { false }
332
342
pageLinks = ""
333
343
location = { location }
344
+ refetchSavedQueries = { refetchSavedQueries }
334
345
/> ,
335
346
{
336
347
router,
@@ -368,6 +379,7 @@ describe('Discover > QueryList', function () {
368
379
pageLinks = ""
369
380
renderPrebuilt = { false }
370
381
location = { location }
382
+ refetchSavedQueries = { refetchSavedQueries }
371
383
/> ,
372
384
{
373
385
deprecatedRouterMocks : true ,
@@ -401,6 +413,7 @@ describe('Discover > QueryList', function () {
401
413
pageLinks = ""
402
414
renderPrebuilt = { false }
403
415
location = { location }
416
+ refetchSavedQueries = { refetchSavedQueries }
404
417
/> ,
405
418
{
406
419
deprecatedRouterMocks : true ,
@@ -443,6 +456,7 @@ describe('Discover > QueryList', function () {
443
456
pageLinks = ""
444
457
renderPrebuilt = { false }
445
458
location = { location }
459
+ refetchSavedQueries = { refetchSavedQueries }
446
460
/> ,
447
461
{
448
462
deprecatedRouterMocks : true ,
@@ -471,6 +485,7 @@ describe('Discover > QueryList', function () {
471
485
renderPrebuilt = { false }
472
486
pageLinks = ""
473
487
location = { location }
488
+ refetchSavedQueries = { refetchSavedQueries }
474
489
/> ,
475
490
{
476
491
deprecatedRouterMocks : true ,
@@ -509,6 +524,7 @@ describe('Discover > QueryList', function () {
509
524
pageLinks = ""
510
525
renderPrebuilt = { false }
511
526
location = { location }
527
+ refetchSavedQueries = { refetchSavedQueries }
512
528
/>
513
529
) ;
514
530
@@ -545,6 +561,7 @@ describe('Discover > QueryList', function () {
545
561
pageLinks = ""
546
562
renderPrebuilt = { false }
547
563
location = { location }
564
+ refetchSavedQueries = { refetchSavedQueries }
548
565
/>
549
566
) ;
550
567
@@ -580,6 +597,7 @@ describe('Discover > QueryList', function () {
580
597
] }
581
598
pageLinks = ""
582
599
location = { location }
600
+ refetchSavedQueries = { refetchSavedQueries }
583
601
/> ,
584
602
{
585
603
deprecatedRouterMocks : true ,
@@ -647,6 +665,7 @@ describe('Discover > QueryList', function () {
647
665
] }
648
666
pageLinks = ""
649
667
location = { location }
668
+ refetchSavedQueries = { refetchSavedQueries }
650
669
/> ,
651
670
{
652
671
deprecatedRouterMocks : true ,
@@ -714,6 +733,7 @@ describe('Discover > QueryList', function () {
714
733
] }
715
734
pageLinks = ""
716
735
location = { location }
736
+ refetchSavedQueries = { refetchSavedQueries }
717
737
/>
718
738
) ;
719
739
@@ -750,6 +770,7 @@ describe('Discover > QueryList', function () {
750
770
] }
751
771
pageLinks = ""
752
772
location = { location }
773
+ refetchSavedQueries = { refetchSavedQueries }
753
774
/>
754
775
) ;
755
776
@@ -787,6 +808,7 @@ describe('Discover > QueryList', function () {
787
808
] }
788
809
pageLinks = ""
789
810
location = { location }
811
+ refetchSavedQueries = { refetchSavedQueries }
790
812
/> ,
791
813
{
792
814
deprecatedRouterMocks : true ,
0 commit comments