import { FC } from 'react' import { CURRENT_PROFILE_KEY_NAME } from '@baseapp-frontend/utils/constants/profile' import { CookieProvider } from '@baseapp-frontend/utils/hooks/useCookie' import { MinimalProfile } from '../../../../../types/profile' import { CurrentProfileProvider } from '../../../../profile' import { WithAuthenticationTestProvidersProps } from './types' const withAuthenticationTestProviders = (Component: FC) => ({ context, initialCookies, ...props }: Props & WithAuthenticationTestProvidersProps) => { const currentProfile = context?.parameters?.initialProfile ?? null return ( initialCookies={{ [CURRENT_PROFILE_KEY_NAME]: currentProfile, ...initialCookies, }} > ) } export default withAuthenticationTestProviders