Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
lbeneston-pass committed Nov 26, 2024
1 parent 669c41f commit c185a7c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions .storybook/mocks/firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const firebase = {
delete: () => {},
onSnapshot: (callback) => {
callback({ data: () => {}, get: () => {} })
return () => {}
},
}),
}),
Expand Down
10 changes: 10 additions & 0 deletions src/features/favorites/pages/Favorites.perf.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ import { paginatedFavoritesResponseSnap } from 'features/favorites/fixtures/pagi
import { simulateBackend } from 'features/favorites/helpers/simulateBackend'
import { Favorites } from 'features/favorites/pages/Favorites'
import { beneficiaryUser } from 'fixtures/user'
import * as useFeatureFlagAPI from 'libs/firebase/firestore/featureFlags/useFeatureFlag'
import { RemoteStoreFeatureFlags } from 'libs/firebase/firestore/types'
import { decodedTokenWithRemainingLifetime } from 'libs/jwt/fixtures'
import { storage } from 'libs/storage'
import { mockServer } from 'tests/mswServer'
import { reactQueryProviderHOC } from 'tests/reactQueryProviderHOC'
import { measurePerformance, screen } from 'tests/utils'

jest.mock('libs/firebase/firestore/exchangeRates/useGetPacificFrancToEuroRate')
const useFeatureFlagSpy = jest.spyOn(useFeatureFlagAPI, 'useFeatureFlag')

jest.mock('libs/firebase/analytics/analytics')

jest.mock('features/favorites/context/FavoritesWrapper')
Expand All @@ -39,6 +44,7 @@ jest.mock('libs/network/NetInfoWrapper')

describe('<Favorites />', () => {
beforeEach(() => {
activateFeatureFlags([RemoteStoreFeatureFlags.ENABLE_PACIFIC_FRANC_CURRENCY])
mockServer.getApi<UserProfileResponse>('/v1/me', beneficiaryUser)
})

Expand All @@ -59,3 +65,7 @@ describe('<Favorites />', () => {
)
})
})

const activateFeatureFlags = (activeFeatureFlags: RemoteStoreFeatureFlags[] = []) => {
useFeatureFlagSpy.mockImplementation((flag) => activeFeatureFlags.includes(flag))
}

0 comments on commit c185a7c

Please sign in to comment.