| 9 | const freshFeatures = { fresh_flag: { defaultValue: true } }; |
| 10 | |
| 11 | const mockBootResponses = (...responses: Record<string, unknown>[]) => { |
| 12 | const fetchMock = jest.fn(); |
| 13 | responses.forEach((response) => |
| 14 | fetchMock.mockResolvedValueOnce({ |
| 15 | json: jest.fn().mockResolvedValue(response), |
| 16 | }), |
| 17 | ); |
| 18 | global.fetch = fetchMock as unknown as typeof fetch; |
| 19 | return fetchMock; |
| 20 | }; |
| 21 | |
| 22 | const getRequestedFv = (fetchMock: jest.Mock, call = 0) => |
| 23 | new URL(fetchMock.mock.calls[call][0]).searchParams.get('fv'); |