Skip to content

Commit 9193e14

Browse files
committed
fix: tests frontend
Signed-off-by: Rafael Silva (rafaelsi) <rafaelsi@cisco.com>
1 parent 4d73f2b commit 9193e14

1 file changed

Lines changed: 54 additions & 10 deletions

File tree

frontend/src/router/tests/routes.test.tsx

Lines changed: 54 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,14 @@ describe('useRoutes', () => {
146146
const mockState = {
147147
isEmptyIdp: false,
148148
isAdmin: true,
149+
totalAgenticServices: 0,
150+
totalPolicies: 0,
149151
setIsAdmin: vi.fn(),
150152
setSession: vi.fn(),
151153
setIsEmptyIdp: vi.fn(),
152-
setIssuerSettings: vi.fn()
154+
setIssuerSettings: vi.fn(),
155+
setTotalAgenticServices: vi.fn(),
156+
setTotalPolicies: vi.fn()
153157
};
154158
return selector ? selector(mockState) : mockState;
155159
});
@@ -174,10 +178,14 @@ describe('useRoutes', () => {
174178
const mockState = {
175179
isEmptyIdp: true,
176180
isAdmin: false,
181+
totalAgenticServices: 0,
182+
totalPolicies: 0,
177183
setIsAdmin: vi.fn(),
178184
setSession: vi.fn(),
179185
setIsEmptyIdp: vi.fn(),
180186
setIssuerSettings: vi.fn(),
187+
setTotalAgenticServices: vi.fn(),
188+
setTotalPolicies: vi.fn(),
181189
otherProperty: 'should not be selected'
182190
};
183191

@@ -215,10 +223,14 @@ describe('useRoutes', () => {
215223
const mockState = {
216224
isEmptyIdp: false,
217225
isAdmin: true,
226+
totalAgenticServices: 0,
227+
totalPolicies: 0,
218228
setIsAdmin: vi.fn(),
219229
setSession: vi.fn(),
220230
setIsEmptyIdp: vi.fn(),
221-
setIssuerSettings: vi.fn()
231+
setIssuerSettings: vi.fn(),
232+
setTotalAgenticServices: vi.fn(),
233+
setTotalPolicies: vi.fn()
222234
};
223235
return selector ? selector(mockState) : mockState;
224236
});
@@ -235,10 +247,14 @@ describe('useRoutes', () => {
235247
const mockState = {
236248
isEmptyIdp: true,
237249
isAdmin: true,
250+
totalAgenticServices: 0,
251+
totalPolicies: 0,
238252
setIsAdmin: vi.fn(),
239253
setSession: vi.fn(),
240254
setIsEmptyIdp: vi.fn(),
241-
setIssuerSettings: vi.fn()
255+
setIssuerSettings: vi.fn(),
256+
setTotalAgenticServices: vi.fn(),
257+
setTotalPolicies: vi.fn()
242258
};
243259
return selector ? selector(mockState) : mockState;
244260
});
@@ -257,10 +273,14 @@ describe('useRoutes', () => {
257273
const mockState = {
258274
isEmptyIdp: false,
259275
isAdmin: true,
276+
totalAgenticServices: 0,
277+
totalPolicies: 0,
260278
setIsAdmin: vi.fn(),
261279
setSession: vi.fn(),
262280
setIsEmptyIdp: vi.fn(),
263-
setIssuerSettings: vi.fn()
281+
setIssuerSettings: vi.fn(),
282+
setTotalAgenticServices: vi.fn(),
283+
setTotalPolicies: vi.fn()
264284
};
265285
return selector ? selector(mockState) : mockState;
266286
});
@@ -277,10 +297,14 @@ describe('useRoutes', () => {
277297
const mockState = {
278298
isEmptyIdp: false,
279299
isAdmin: false,
300+
totalAgenticServices: 0,
301+
totalPolicies: 0,
280302
setIsAdmin: vi.fn(),
281303
setSession: vi.fn(),
282304
setIsEmptyIdp: vi.fn(),
283-
setIssuerSettings: vi.fn()
305+
setIssuerSettings: vi.fn(),
306+
setTotalAgenticServices: vi.fn(),
307+
setTotalPolicies: vi.fn()
284308
};
285309
return selector ? selector(mockState) : mockState;
286310
});
@@ -329,10 +353,14 @@ describe('useRoutes', () => {
329353
const mockState = {
330354
isEmptyIdp: true,
331355
isAdmin: true,
356+
totalAgenticServices: 0,
357+
totalPolicies: 0,
332358
setIsAdmin: vi.fn(),
333359
setSession: vi.fn(),
334360
setIsEmptyIdp: vi.fn(),
335-
setIssuerSettings: vi.fn()
361+
setIssuerSettings: vi.fn(),
362+
setTotalAgenticServices: vi.fn(),
363+
setTotalPolicies: vi.fn()
336364
};
337365
return selector ? selector(mockState) : mockState;
338366
});
@@ -349,10 +377,14 @@ describe('useRoutes', () => {
349377
const mockState = {
350378
isEmptyIdp: false,
351379
isAdmin: false,
380+
totalAgenticServices: 0,
381+
totalPolicies: 0,
352382
setIsAdmin: vi.fn(),
353383
setSession: vi.fn(),
354384
setIsEmptyIdp: vi.fn(),
355-
setIssuerSettings: vi.fn()
385+
setIssuerSettings: vi.fn(),
386+
setTotalAgenticServices: vi.fn(),
387+
setTotalPolicies: vi.fn()
356388
};
357389
return selector ? selector(mockState) : mockState;
358390
});
@@ -369,10 +401,14 @@ describe('useRoutes', () => {
369401
const mockState = {
370402
isEmptyIdp: true,
371403
isAdmin: false,
404+
totalAgenticServices: 0,
405+
totalPolicies: 0,
372406
setIsAdmin: vi.fn(),
373407
setSession: vi.fn(),
374408
setIsEmptyIdp: vi.fn(),
375-
setIssuerSettings: vi.fn()
409+
setIssuerSettings: vi.fn(),
410+
setTotalAgenticServices: vi.fn(),
411+
setTotalPolicies: vi.fn()
376412
};
377413
return selector ? selector(mockState) : mockState;
378414
});
@@ -422,10 +458,14 @@ describe('useRoutes', () => {
422458
const mockState = {
423459
isEmptyIdp: true,
424460
isAdmin: false,
461+
totalAgenticServices: 0,
462+
totalPolicies: 0,
425463
setIsAdmin: vi.fn(),
426464
setSession: vi.fn(),
427465
setIsEmptyIdp: vi.fn(),
428-
setIssuerSettings: vi.fn()
466+
setIssuerSettings: vi.fn(),
467+
setTotalAgenticServices: vi.fn(),
468+
setTotalPolicies: vi.fn()
429469
};
430470
return selector ? selector(mockState) : mockState;
431471
});
@@ -462,10 +502,14 @@ describe('useRoutes', () => {
462502
const mockState = {
463503
isEmptyIdp: true,
464504
isAdmin: false,
505+
totalAgenticServices: 0,
506+
totalPolicies: 0,
465507
setIsAdmin: vi.fn(),
466508
setSession: vi.fn(),
467509
setIsEmptyIdp: vi.fn(),
468-
setIssuerSettings: vi.fn()
510+
setIssuerSettings: vi.fn(),
511+
setTotalAgenticServices: vi.fn(),
512+
setTotalPolicies: vi.fn()
469513
};
470514
return selector ? selector(mockState) : mockState;
471515
});

0 commit comments

Comments
 (0)