* MM_30476 : Added all isolated tables from the server schema * MM_30476 : Updated 'test' script in package.json * MM_30476 : Rename table schemas to avoid name collision * MM_30476 : ADDED @babel/plugin-tranform-flow-strip-types * MM_30476 : ADDED test for default schema * MM_30476 : ADDED tests to server schema * MM_30476 : ADDED tests for models and schema * MM_30476 : ADDED tests for models and schema * MM_30476 : Removed the tests on the models.
57 lines
2 KiB
TypeScript
57 lines
2 KiB
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {MM_TABLES} from '@constants/database';
|
|
|
|
import {serverSchema} from './index';
|
|
const {CUSTOM_EMOJI, ROLE, SYSTEM, TERMS_OF_SERVICE} = MM_TABLES.SERVER;
|
|
|
|
describe('*** Test schema for SERVER database ***', () => {
|
|
it('=> The SERVER SCHEMA should strictly match', () => {
|
|
expect(serverSchema).toEqual({
|
|
version: 1,
|
|
tables: {
|
|
[CUSTOM_EMOJI]: {
|
|
name: CUSTOM_EMOJI,
|
|
columns: {
|
|
name: {name: 'name', type: 'string'},
|
|
},
|
|
columnArray: [
|
|
{name: 'name', type: 'string'},
|
|
],
|
|
},
|
|
[ROLE]: {
|
|
name: ROLE,
|
|
columns: {
|
|
name: {name: 'name', type: 'string'},
|
|
permissions: {name: 'permissions', type: 'string'},
|
|
},
|
|
columnArray: [
|
|
{name: 'name', type: 'string'},
|
|
{name: 'permissions', type: 'string'},
|
|
],
|
|
},
|
|
[SYSTEM]: {
|
|
name: SYSTEM,
|
|
columns: {
|
|
name: {name: 'name', type: 'string'},
|
|
value: {name: 'value', type: 'string'},
|
|
},
|
|
columnArray: [
|
|
{name: 'name', type: 'string'},
|
|
{name: 'value', type: 'string'},
|
|
],
|
|
},
|
|
[TERMS_OF_SERVICE]: {
|
|
name: TERMS_OF_SERVICE,
|
|
columns: {
|
|
accepted_at: {name: 'accepted_at', type: 'number'},
|
|
},
|
|
columnArray: [
|
|
{name: 'accepted_at', type: 'number'},
|
|
],
|
|
},
|
|
},
|
|
});
|
|
});
|
|
});
|