mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
merge of PR-2465: setup unit tests for federation
This commit is contained in:
parent
8bf95ad0ee
commit
814bb996db
@ -10,7 +10,7 @@ Decimal.set({
|
||||
})
|
||||
|
||||
const constants = {
|
||||
DB_VERSION: '0055-consistent_deleted_users',
|
||||
DB_VERSION: '0056-add_communities_table',
|
||||
DECAY_START_TIME: new Date('2021-05-13 17:46:31-0000'), // GMT+0
|
||||
LOG4JS_CONFIG: 'log4js-config.json',
|
||||
// default log level on production should be info
|
||||
|
||||
@ -155,6 +155,25 @@ describe('federation', () => {
|
||||
expect(true).toBe(true)
|
||||
})
|
||||
})
|
||||
describe('on data with receiving simply a string', () => {
|
||||
beforeEach(() => {
|
||||
socketEventMocks.data(
|
||||
Buffer.from(
|
||||
`hello here is a new community and i don't know how to communicate with you`,
|
||||
),
|
||||
)
|
||||
})
|
||||
it('logged the received data', () => {
|
||||
expect(logger.info).toBeCalledWith(
|
||||
`data: hello here is a new community and i don't know how to communicate with you`,
|
||||
)
|
||||
})
|
||||
it('logged a warning of unexpected data format and structure', () => {
|
||||
expect(logger.warn).toBeCalledWith(
|
||||
`received totaly wrong or too much apiVersions-Definition JSON-String:hello here is a new community and i don't know how to communicate with you`,
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@ -1 +1 @@
|
||||
export { Community } from './0055-add_communities_table/Community'
|
||||
export { Community } from './0056-add_communities_table/Community'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user