2020-11-22 15:50:07 -05:00
|
|
|
/*
|
2021-01-06 15:37:59 -05:00
|
|
|
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
2020-11-22 15:50:07 -05:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2021-03-09 17:00:14 -05:00
|
|
|
declare namespace Cypress {
|
|
|
|
interface Chainable {
|
|
|
|
loadConfig(): Chainable<Window>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-18 16:17:36 -04:00
|
|
|
export const branding = {
|
2021-03-09 17:03:54 -05:00
|
|
|
name: 'DEMO Corp',
|
2021-05-02 16:38:43 -04:00
|
|
|
logo: '/mock-backend/public/img/demo.png'
|
2020-07-18 16:17:36 -04:00
|
|
|
}
|
|
|
|
|
2021-03-09 17:00:14 -05:00
|
|
|
export const authProviders = {
|
|
|
|
facebook: true,
|
|
|
|
github: true,
|
|
|
|
twitter: true,
|
|
|
|
gitlab: true,
|
|
|
|
dropbox: true,
|
|
|
|
ldap: true,
|
|
|
|
google: true,
|
|
|
|
saml: true,
|
|
|
|
oauth2: true,
|
|
|
|
internal: true,
|
|
|
|
openid: true
|
|
|
|
}
|
|
|
|
|
|
|
|
export const config = {
|
|
|
|
allowAnonymous: true,
|
|
|
|
authProviders: authProviders,
|
|
|
|
branding: branding,
|
|
|
|
customAuthNames: {
|
|
|
|
ldap: 'FooBar',
|
|
|
|
oauth2: 'Olaf2',
|
|
|
|
saml: 'aufSAMLn.de'
|
|
|
|
},
|
|
|
|
maxDocumentLength: 200,
|
2021-05-01 17:01:42 -04:00
|
|
|
specialUrls: {
|
2021-03-09 17:00:14 -05:00
|
|
|
privacy: 'https://example.com/privacy',
|
|
|
|
termsOfUse: 'https://example.com/termsOfUse',
|
|
|
|
imprint: 'https://example.com/imprint'
|
|
|
|
},
|
|
|
|
plantumlServer: 'http://mock-plantuml.local',
|
|
|
|
version: {
|
|
|
|
version: 'mock',
|
|
|
|
sourceCodeUrl: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
|
|
|
|
issueTrackerUrl: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'
|
|
|
|
},
|
|
|
|
'iframeCommunication': {
|
2021-05-01 17:01:42 -04:00
|
|
|
'editorOrigin': 'http://127.0.0.1:3001/',
|
|
|
|
'rendererOrigin': 'http://127.0.0.1:3001/'
|
2021-03-09 17:00:14 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Cypress.Commands.add('loadConfig', (additionalConfig?: Partial<typeof config>) => {
|
2021-05-02 16:38:43 -04:00
|
|
|
return cy.intercept('/mock-backend/api/private/config', {
|
2020-11-30 06:31:54 -05:00
|
|
|
statusCode: 200,
|
|
|
|
body: {
|
2021-03-09 17:00:14 -05:00
|
|
|
...config,
|
|
|
|
...additionalConfig
|
2020-07-16 05:22:53 -04:00
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
2021-04-14 16:28:50 -04:00
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
cy.loadConfig()
|
|
|
|
})
|