diff --git a/services/web/test/frontend/features/file-tree/helpers/file-tree-provider.tsx b/services/web/test/frontend/features/file-tree/helpers/file-tree-provider.tsx index 5996b71145..5af4b81333 100644 --- a/services/web/test/frontend/features/file-tree/helpers/file-tree-provider.tsx +++ b/services/web/test/frontend/features/file-tree/helpers/file-tree-provider.tsx @@ -1,17 +1,23 @@ -import { FC } from 'react' +import { ComponentProps, FC, useRef } from 'react' import FileTreeContext from '@/features/file-tree/components/file-tree-context' export const FileTreeProvider: FC<{ refProviders?: Record }> = ({ children, refProviders = {} }) => { + const propsRef = + useRef, 'refProviders'>>() + + if (propsRef.current === undefined) { + propsRef.current = { + reindexReferences: cy.stub().as('reindexReferences'), + setRefProviderEnabled: cy.stub().as('setRefProviderEnabled'), + setStartedFreeTrial: cy.stub().as('setStartedFreeTrial'), + onSelect: cy.stub(), + } + } + return ( - {}} - > + <>{children} )