mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
full test for communities, another try for docker compose
This commit is contained in:
parent
4be256575f
commit
7e48e4f850
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@ -383,7 +383,7 @@ jobs:
|
||||
- name: backend | docker-compose
|
||||
run: docker-compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps database backend
|
||||
- name: backend Unit tests | up
|
||||
run: docker-compose exec -T backend yarn run test
|
||||
run: docker-compose exec -T backend yarn test
|
||||
##########################################################################
|
||||
# COVERAGE CHECK BACKEND #################################################
|
||||
##########################################################################
|
||||
|
||||
@ -3,6 +3,9 @@
|
||||
|
||||
import { createTestClient } from 'apollo-server-testing'
|
||||
import createServer from '../../server/createServer'
|
||||
import CONFIG from '../../config'
|
||||
|
||||
jest.mock('../../config')
|
||||
|
||||
let query: any
|
||||
|
||||
@ -24,6 +27,18 @@ describe('CommunityResolver', () => {
|
||||
}
|
||||
`
|
||||
|
||||
const communities = `
|
||||
query {
|
||||
communities {
|
||||
id
|
||||
name
|
||||
url
|
||||
description
|
||||
registerUrl
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
describe('getCommunityInfo', () => {
|
||||
it('returns the default values', async () => {
|
||||
expect(query({ query: getCommunityInfoQuery })).resolves.toMatchObject({
|
||||
@ -38,4 +53,64 @@ describe('CommunityResolver', () => {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('communities', () => {
|
||||
describe('PRODUCTION = false', () => {
|
||||
beforeEach(() => {
|
||||
CONFIG.PRODUCTION = false
|
||||
})
|
||||
|
||||
it('returns three communities', async () => {
|
||||
expect(query({ query: communities })).resolves.toMatchObject({
|
||||
data: {
|
||||
communities: [
|
||||
{
|
||||
id: 1,
|
||||
name: 'Gradido Entwicklung',
|
||||
description: 'Die lokale Entwicklungsumgebung von Gradido.',
|
||||
url: 'http://localhost/vue/',
|
||||
registerUrl: 'http://localhost/vue/register-community',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: 'Gradido Staging',
|
||||
description: 'Der Testserver der Gradido-Akademie.',
|
||||
url: 'https://stage1.gradido.net/vue/',
|
||||
registerUrl: 'https://stage1.gradido.net/vue/register-community',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: 'Gradido-Akademie',
|
||||
description: 'Freies Institut für Wirtschaftsbionik.',
|
||||
url: 'https://gradido.net',
|
||||
registerUrl: 'https://gdd1.gradido.com/vue/register-community',
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('PRODUCTION = true', () => {
|
||||
beforeEach(() => {
|
||||
CONFIG.PRODUCTION = true
|
||||
})
|
||||
|
||||
it('returns one community', async () => {
|
||||
expect(query({ query: communities })).resolves.toMatchObject({
|
||||
data: {
|
||||
communities: [
|
||||
{
|
||||
id: 3,
|
||||
name: 'Gradido-Akademie',
|
||||
description: 'Freies Institut für Wirtschaftsbionik.',
|
||||
url: 'https://gradido.net',
|
||||
registerUrl: 'https://gdd1.gradido.com/vue/register-community',
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user