@@ -16,6 +16,10 @@ import { nockIgnoreApiPaths } from '../../../lib/nock-util'
16
16
17
17
const t = i18n . t . bind ( i18n )
18
18
19
+ jest . mock ( '../../../resources/utils/resource-request' , ( ) => ( {
20
+ deleteResource : jest . fn ( ( ) => ( { promise : Promise . resolve ( ) } ) ) ,
21
+ } ) )
22
+
19
23
describe ( 'DeleteResourceModal' , ( ) => {
20
24
it ( 'should render delete ACM app no related resources' , ( ) => {
21
25
const resource : IResource = {
@@ -42,6 +46,7 @@ describe('DeleteResourceModal', () => {
42
46
appSetsSharingPlacement = { [ ] }
43
47
appKind = { resource . kind }
44
48
appSetApps = { [ ] }
49
+ deleted = { ( ) => void { } }
45
50
close = { ( ) => void { } }
46
51
t = { t }
47
52
/>
@@ -99,6 +104,7 @@ describe('DeleteResourceModal', () => {
99
104
appSetsSharingPlacement = { [ ] }
100
105
appKind = { resource . kind }
101
106
appSetApps = { [ ] }
107
+ deleted = { ( ) => void { } }
102
108
close = { ( ) => void { } }
103
109
t = { t }
104
110
/>
@@ -168,6 +174,7 @@ describe('DeleteResourceModal', () => {
168
174
appSetsSharingPlacement = { [ ] }
169
175
appKind = { resource . kind }
170
176
appSetApps = { [ ] }
177
+ deleted = { ( ) => void { } }
171
178
close = { ( ) => void { } }
172
179
t = { t }
173
180
/>
@@ -230,6 +237,7 @@ describe('DeleteResourceModal', () => {
230
237
appSetsSharingPlacement = { [ ] }
231
238
appKind = { resource . kind }
232
239
appSetApps = { [ ] }
240
+ deleted = { ( ) => void { } }
233
241
close = { ( ) => void { } }
234
242
t = { t }
235
243
/>
@@ -269,13 +277,15 @@ describe('DeleteResourceModal', () => {
269
277
appSetsSharingPlacement = { [ ] }
270
278
appKind = { resource . kind }
271
279
appSetApps = { [ ] }
280
+ deleted = { ( ) => void { } }
272
281
close = { ( ) => void { } }
273
282
t = { t }
274
283
/>
275
284
</ MemoryRouter >
276
285
)
277
286
278
287
expect ( getByText ( 'Permanently delete ApplicationSet appset1?' ) ) . toBeTruthy ( )
288
+ userEvent . click ( screen . getByRole ( 'button' , { name : / d e l e t e / i } ) )
279
289
} )
280
290
281
291
it ( 'should render delete appset with placement' , ( ) => {
@@ -305,6 +315,7 @@ describe('DeleteResourceModal', () => {
305
315
appSetsSharingPlacement = { [ ] }
306
316
appKind = { resource . kind }
307
317
appSetApps = { appSetApps }
318
+ deleted = { ( ) => void { } }
308
319
close = { ( ) => void { } }
309
320
t = { t }
310
321
/>
@@ -349,6 +360,7 @@ describe('DeleteResourceModal', () => {
349
360
appSetsSharingPlacement = { appSetsSharingPlacement }
350
361
appKind = { resource . kind }
351
362
appSetApps = { appSetApps }
363
+ deleted = { ( ) => void { } }
352
364
close = { ( ) => void { } }
353
365
t = { t }
354
366
/>
0 commit comments