diff --git a/.env.development b/.env.development index c1c50278..a53025ff 100644 --- a/.env.development +++ b/.env.development @@ -2,8 +2,8 @@ # To override locally, make a copy called `.env.development.local` # Refer: https://nextjs.org/docs/basic-features/environment-variables -NEXT_PUBLIC_OONI_API=https://ams-pg-test.ooni.org -NEXT_PUBLIC_USER_FEEDBACK_API=https://ams-pg-test.ooni.org +NEXT_PUBLIC_OONI_API=https://backend-hel.ooni.org +NEXT_PUBLIC_USER_FEEDBACK_API=https://backend-hel.ooni.org NEXT_PUBLIC_EXPLORER_URL=http://localhost:3100 RUN_GIT_COMMIT_SHA_SHORT=yarn --silent git:getCommitSHA:short diff --git a/.env.test b/.env.test index d83d6bf2..ff53368b 100644 --- a/.env.test +++ b/.env.test @@ -3,6 +3,6 @@ # Refer: https://nextjs.org/docs/basic-features/environment-variables NEXT_PUBLIC_OONI_API=https://api.ooni.io -NEXT_PUBLIC_USER_FEEDBACK_API=https://ams-pg-test.ooni.org +NEXT_PUBLIC_USER_FEEDBACK_API=https://backend-hel.ooni.org NEXT_PUBLIC_EXPLORER_URL=https://explorer.test.ooni.org NEXT_PUBLIC_IS_TEST_ENV=1 diff --git a/cypress.config.js b/cypress.config.js index cb127b05..99c12c62 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -12,6 +12,6 @@ module.exports = defineConfig({ testIsolation: false, }, env: { - apiUrl: 'https://ams-pg-test.ooni.org', - } + apiUrl: 'https://backend-hel.ooni.org', + }, }) diff --git a/cypress/mocks/handlers.js b/cypress/mocks/handlers.js index 9ac0016a..e15f7111 100644 --- a/cypress/mocks/handlers.js +++ b/cypress/mocks/handlers.js @@ -1,5 +1,5 @@ import { http } from 'msw' - + const apiBase = Cypress.env('apiUrl') export const handlers = [ @@ -27,32 +27,32 @@ export const handlers = [ ctx.status(200), ctx.json({ bearer: 'abc123', - redirect_to: 'https://explorer.org/' + redirect_to: 'https://explorer.org/', }), ) }), http.post(`${apiBase}/api/_/measurement_feedback`, (req, res, ctx) => { + return res(ctx.status(200), ctx.json({})) + }), +] + +export const failedAccountMetadata = http.get( + 'https://backend-hel.ooni.org/api/_/account_metadata', + (req, res, ctx) => { + return res(ctx.status(401)) + }, +) + +export const userAccountMetadata = http.get( + 'https://backend-hel.ooni.org/api/_/account_metadata', + (req, res, ctx) => { return res( ctx.status(200), ctx.json({ + logged_in: true, + role: 'user', }), ) - }), -] - -export const failedAccountMetadata = http.get('https://ams-pg-test.ooni.org/api/_/account_metadata', (req, res, ctx) => { - return res( - ctx.status(401), - ) -}) - -export const userAccountMetadata = http.get('https://ams-pg-test.ooni.org/api/_/account_metadata', (req, res, ctx) => { - return res( - ctx.status(200), - ctx.json({ - logged_in: true, - role: 'user', - }), - ) -}) + }, +)