Skip to content

Commit

Permalink
Update ENV variables (#949)
Browse files Browse the repository at this point in the history
  • Loading branch information
majakomel authored Jul 16, 2024
1 parent 32d2d8c commit d486d72
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ module.exports = defineConfig({
testIsolation: false,
},
env: {
apiUrl: 'https://ams-pg-test.ooni.org',
}
apiUrl: 'https://backend-hel.ooni.org',
},
})
40 changes: 20 additions & 20 deletions cypress/mocks/handlers.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { http } from 'msw'

const apiBase = Cypress.env('apiUrl')

export const handlers = [
Expand Down Expand Up @@ -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',
}),
)
})
},
)

0 comments on commit d486d72

Please sign in to comment.