diff --git a/cypress/e2e/uxSignals.cy.js b/cypress/e2e/uxSignals.cy.js index 3dd9ba5e..43c35363 100644 --- a/cypress/e2e/uxSignals.cy.js +++ b/cypress/e2e/uxSignals.cy.js @@ -1,6 +1,7 @@ describe('uxSignals', () => { beforeEach(() => { cy.intercept('GET', '/sendinn/api/fyllut/forms/*', cy.spy().as('getFormSpy')); + cy.intercept('GET', '/v2/study/id/*', { fixture: 'uxSignalsStudy.json' }).as('getUxSignalsStudy'); }); it('Should show uxSignals', () => { cy.defaultIntercepts(); diff --git a/mocks/data/uxsignals/panel-uzn9037kdp.json b/cypress/fixtures/uxSignalsStudy.json similarity index 100% rename from mocks/data/uxsignals/panel-uzn9037kdp.json rename to cypress/fixtures/uxSignalsStudy.json diff --git a/mocks/data/uxsignals/index.ts b/mocks/data/uxsignals/index.ts deleted file mode 100644 index a47e7efb..00000000 --- a/mocks/data/uxsignals/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -export const uxSignalsMock = async (id: string) => { - const { default: data } = - (await import(`./${id}.json`, { - assert: { type: 'json' }, - }).catch(() => null)) || - (await import(`./panel-uzn9037kdp.json`, { - assert: { type: 'json' }, - })); - return data; -}; diff --git a/mocks/handlers/uxSignals.ts b/mocks/handlers/uxSignals.ts deleted file mode 100644 index 93598628..00000000 --- a/mocks/handlers/uxSignals.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { HttpResponse, http } from 'msw'; -import { uxSignalsMock } from '../data/uxsignals'; - -export const getUxSignals = http.get('https://api.uxsignals.com/v2/study/id/:uxSignalsId', async ({ params }) => { - const { uxSignalsId } = params; - const fyllutForm = await uxSignalsMock(uxSignalsId as string); - return HttpResponse.json(fyllutForm, { status: 200 }); -});