mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 23:24:46 -04:00
Change api route to /api/private (#1189)
This commit is contained in:
parent
344304f329
commit
29d9d49f5a
20 changed files with 11 additions and 11 deletions
|
@ -31,7 +31,7 @@ describe('File upload', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.intercept({
|
cy.intercept({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: '/api/v2/media/upload'
|
url: '/api/private/media/upload'
|
||||||
}, {
|
}, {
|
||||||
statusCode: 201,
|
statusCode: 201,
|
||||||
body: {
|
body: {
|
||||||
|
@ -86,7 +86,7 @@ describe('File upload', () => {
|
||||||
it('upload fails', () => {
|
it('upload fails', () => {
|
||||||
cy.intercept({
|
cy.intercept({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: '/api/v2/media/upload'
|
url: '/api/private/media/upload'
|
||||||
}, {
|
}, {
|
||||||
statusCode: 400
|
statusCode: 400
|
||||||
})
|
})
|
||||||
|
|
|
@ -26,7 +26,7 @@ describe('History', () => {
|
||||||
describe('Pinning', () => {
|
describe('Pinning', () => {
|
||||||
describe('working', () => {
|
describe('working', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.intercept('PUT', '/api/v2/history/features', (req) => {
|
cy.intercept('PUT', '/api/private/history/features', (req) => {
|
||||||
req.reply(200, req.body)
|
req.reply(200, req.body)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -60,7 +60,7 @@ describe('History', () => {
|
||||||
|
|
||||||
describe('failing', () => {
|
describe('failing', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.intercept('PUT', '/api/v2/history/features', {
|
cy.intercept('PUT', '/api/private/history/features', {
|
||||||
statusCode: 401
|
statusCode: 401
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
describe('profile page', () => {
|
describe('profile page', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.intercept({
|
cy.intercept({
|
||||||
url: '/api/v2/tokens',
|
url: '/api/private/tokens',
|
||||||
method: 'GET'
|
method: 'GET'
|
||||||
}, {
|
}, {
|
||||||
body: [
|
body: [
|
||||||
|
@ -18,7 +18,7 @@ describe('profile page', () => {
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
cy.intercept({
|
cy.intercept({
|
||||||
url: '/api/v2/tokens',
|
url: '/api/private/tokens',
|
||||||
method: 'POST'
|
method: 'POST'
|
||||||
}, {
|
}, {
|
||||||
body: {
|
body: {
|
||||||
|
@ -28,7 +28,7 @@ describe('profile page', () => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
cy.intercept({
|
cy.intercept({
|
||||||
url: '/api/v2/tokens/1601991518',
|
url: '/api/private/tokens/1601991518',
|
||||||
method: 'DELETE'
|
method: 'DELETE'
|
||||||
}, {
|
}, {
|
||||||
body: []
|
body: []
|
||||||
|
|
|
@ -83,7 +83,7 @@ describe('When logged-out ', () => {
|
||||||
cy.get('[data-cy=sign-in-button]')
|
cy.get('[data-cy=sign-in-button]')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
// The absolute URL is used because it is defined as API base URL absolute.
|
// The absolute URL is used because it is defined as API base URL absolute.
|
||||||
.should('have.attr', 'href', 'http://127.0.0.1:3001/api/v2/auth/saml')
|
.should('have.attr', 'href', 'http://127.0.0.1:3001/api/private/auth/saml')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ export const config = {
|
||||||
}
|
}
|
||||||
|
|
||||||
Cypress.Commands.add('loadConfig', (additionalConfig?: Partial<typeof config>) => {
|
Cypress.Commands.add('loadConfig', (additionalConfig?: Partial<typeof config>) => {
|
||||||
return cy.intercept('/api/v2/config', {
|
return cy.intercept('/api/private/config', {
|
||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
body: {
|
body: {
|
||||||
...config,
|
...config,
|
||||||
|
|
|
@ -17,7 +17,7 @@ Cypress.Commands.add('visitTestEditor', (query?: string) => {
|
||||||
})
|
})
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.intercept(`/api/v2/notes/${ testNoteId }-get`, {
|
cy.intercept(`/api/private/notes/${ testNoteId }-get`, {
|
||||||
'id': 'ABC123',
|
'id': 'ABC123',
|
||||||
'alias': 'banner',
|
'alias': 'banner',
|
||||||
'lastChange': {
|
'lastChange': {
|
||||||
|
|
|
@ -12,7 +12,7 @@ import { getAndSetUser } from '../../login-page/auth/utils'
|
||||||
|
|
||||||
export const loadAllConfig: (baseUrl: string) => Promise<void> = async (baseUrl) => {
|
export const loadAllConfig: (baseUrl: string) => Promise<void> = async (baseUrl) => {
|
||||||
setApiUrl({
|
setApiUrl({
|
||||||
apiUrl: (process.env.REACT_APP_BACKEND || baseUrl) + '/api/v2'
|
apiUrl: (process.env.REACT_APP_BACKEND || baseUrl) + '/api/private'
|
||||||
})
|
})
|
||||||
|
|
||||||
const config = await getConfig()
|
const config = await getConfig()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue