Refactor handling of environment variables (#2303)

* Refactor environment variables

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2022-09-16 11:03:29 +02:00 committed by GitHub
parent e412115a78
commit 39a4125cb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
85 changed files with 624 additions and 461 deletions

View file

@ -12,7 +12,7 @@ describe('Delete note', () => {
})
it('correctly deletes a note', () => {
cy.intercept('DELETE', `/api/mock-backend/private/notes/${testNoteId}`, {
cy.intercept('DELETE', `api/private/notes/${testNoteId}`, {
statusCode: 204
})
cy.getByCypressId('sidebar.deleteNote.button').click()

View file

@ -17,7 +17,7 @@ describe('File upload', () => {
cy.intercept(
{
method: 'POST',
url: '/api/mock-backend/private/media'
url: 'api/private/media'
},
{
statusCode: 201,
@ -74,7 +74,7 @@ describe('File upload', () => {
cy.intercept(
{
method: 'POST',
url: '/api/mock-backend/private/media'
url: 'api/private/media'
},
{
statusCode: 400

View file

@ -24,7 +24,7 @@ describe('History', () => {
describe('is as given when not empty', () => {
beforeEach(() => {
cy.clearLocalStorage('history')
cy.intercept('GET', '/api/mock-backend/private/me/history', {
cy.intercept('GET', 'api/private/me/history', {
body: [
{
identifier: 'cypress',
@ -51,7 +51,7 @@ describe('History', () => {
describe('is untitled when not empty', () => {
beforeEach(() => {
cy.clearLocalStorage('history')
cy.intercept('GET', '/api/mock-backend/private/me/history', {
cy.intercept('GET', 'api/private/me/history', {
body: [
{
identifier: 'cypress-no-title',
@ -84,7 +84,7 @@ describe('History', () => {
describe('working', () => {
beforeEach(() => {
cy.intercept('PUT', '/api/mock-backend/private/me/history/features', (req) => {
cy.intercept('PUT', 'api/private/me/history/features', (req) => {
req.reply(200, req.body)
})
})
@ -106,7 +106,7 @@ describe('History', () => {
describe('failing', () => {
beforeEach(() => {
cy.intercept('PUT', '/api/mock-backend/private/me/history/features', {
cy.intercept('PUT', 'api/private/me/history/features', {
statusCode: 401
})
})
@ -128,7 +128,7 @@ describe('History', () => {
describe('Import', () => {
beforeEach(() => {
cy.clearLocalStorage('history')
cy.intercept('GET', '/api/mock-backend/private/me/history', {
cy.intercept('GET', 'api/private/me/history', {
body: []
})
cy.visitHistory()

View file

@ -7,7 +7,7 @@
/* eslint-disable @typescript-eslint/no-unsafe-call */
describe('Intro page', () => {
beforeEach(() => {
cy.intercept('/mock-public/intro.md', 'test content')
cy.intercept('public/intro.md', 'test content')
cy.visitHome()
})
@ -17,7 +17,7 @@ describe('Intro page', () => {
})
it("won't show anything if no content was found", () => {
cy.intercept('/mock-public/intro.md', {
cy.intercept('public/intro.md', {
statusCode: 404
})
cy.visitHome()

View file

@ -11,13 +11,13 @@ const motdMockHtml = 'This is the <strong>mock</strong> Motd call'
describe('Motd', () => {
const mockExistingMotd = (useEtag?: boolean, content = motdMockContent) => {
cy.intercept('GET', '/mock-public/motd.md', {
cy.intercept('GET', 'public/motd.md', {
statusCode: 200,
headers: { [useEtag ? 'etag' : 'Last-Modified']: MOCK_LAST_MODIFIED },
body: content
})
cy.intercept('HEAD', '/mock-public/motd.md', {
cy.intercept('HEAD', 'public/motd.md', {
statusCode: 200,
headers: { [useEtag ? 'etag' : 'Last-Modified']: MOCK_LAST_MODIFIED }
})

View file

@ -8,7 +8,7 @@ describe('profile page', () => {
beforeEach(() => {
cy.intercept(
{
url: '/api/mock-backend/private/tokens',
url: 'api/private/tokens',
method: 'GET'
},
{
@ -25,7 +25,7 @@ describe('profile page', () => {
)
cy.intercept(
{
url: '/api/mock-backend/private/tokens',
url: 'api/private/tokens',
method: 'POST'
},
{
@ -42,7 +42,7 @@ describe('profile page', () => {
)
cy.intercept(
{
url: '/api/mock-backend/private/tokens/cypress',
url: 'api/private/tokens/cypress',
method: 'DELETE'
},
{