@@ -3,6 +3,12 @@ import React from 'react';
33import { ApiApplications } from './ApiApplications' ;
44import { fireEvent , waitFor , render } from '@testing-library/react' ;
55import { AdminContext } from 'react-admin' ;
6+ import { QueryClient , QueryClientProvider } from '@tanstack/react-query' ;
7+
8+ // Mock the useLayer7Notify hook
9+ jest . mock ( '../../useLayer7Notify' , ( ) => ( {
10+ useLayer7Notify : ( ) => jest . fn ( ) ,
11+ } ) ) ;
612
713describe ( 'Applications' , ( ) => {
814 test ( 'should allow to select an application' , async ( ) => {
@@ -89,10 +95,23 @@ describe('Applications', () => {
8995 } ,
9096 } ;
9197
98+ const queryClient = new QueryClient ( {
99+ defaultOptions : {
100+ queries : {
101+ retry : false ,
102+ } ,
103+ mutations : {
104+ retry : false ,
105+ } ,
106+ } ,
107+ } ) ;
108+
92109 const { getByLabelText, queryByText } = render (
93- < AdminContext dataProvider = { dataProvider } >
94- < ApiApplications id = "api_1" />
95- </ AdminContext >
110+ < QueryClientProvider client = { queryClient } >
111+ < AdminContext dataProvider = { dataProvider } >
112+ < ApiApplications id = "api_1" />
113+ </ AdminContext >
114+ </ QueryClientProvider >
96115 ) ;
97116
98117 const appSelect = getByLabelText (
@@ -179,10 +198,23 @@ describe('Applications', () => {
179198 } ) ,
180199 } ;
181200
201+ const queryClient = new QueryClient ( {
202+ defaultOptions : {
203+ queries : {
204+ retry : false ,
205+ } ,
206+ mutations : {
207+ retry : false ,
208+ } ,
209+ } ,
210+ } ) ;
211+
182212 const { getByLabelText, findByText, getByText } = render (
183- < AdminContext dataProvider = { dataProvider } >
184- < ApiApplications id = "api_1" />
185- </ AdminContext >
213+ < QueryClientProvider client = { queryClient } >
214+ < AdminContext dataProvider = { dataProvider } >
215+ < ApiApplications id = "api_1" />
216+ </ AdminContext >
217+ </ QueryClientProvider >
186218 ) ;
187219
188220 const appSelect = getByLabelText (
0 commit comments