Files
mattermost-mobile/app/database/default/schema/test.ts
Avinash Lingaloo 3e8c275486 MM_30476 [v2] Added all isolated tables from the server schema (#5070)
* 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.
2021-01-07 13:48:23 +04:00

60 lines
2.4 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {MM_TABLES} from '@constants/database';
import {defaultSchema} from './index';
const {APP, GLOBAL, SERVERS} = MM_TABLES.DEFAULT;
describe('*** Test schema for DEFAULT database ***', () => {
it('=> The DEFAULT SCHEMA should strictly match', () => {
expect(defaultSchema).toEqual({
version: 1,
tables: {
[APP]: {
name: APP,
columns: {
build_number: {name: 'build_number', type: 'string'},
created_at: {name: 'created_at', type: 'number'},
version_number: {name: 'version_number', type: 'string'},
},
columnArray: [
{name: 'build_number', type: 'string'},
{name: 'created_at', type: 'number'},
{name: 'version_number', type: 'string'},
],
},
[GLOBAL]: {
name: GLOBAL,
columns: {
name: {name: 'name', type: 'string', isIndexed: true},
value: {name: 'value', type: 'string'},
},
columnArray: [
{name: 'name', type: 'string', isIndexed: true},
{name: 'value', type: 'string'},
],
},
[SERVERS]: {
name: SERVERS,
columns: {
db_path: {name: 'db_path', type: 'string'},
display_name: {name: 'display_name', type: 'string'},
mention_count: {name: 'mention_count', type: 'number'},
unread_count: {name: 'unread_count', type: 'number'},
url: {name: 'url', type: 'string', isIndexed: true},
},
columnArray: [
{name: 'db_path', type: 'string'},
{name: 'display_name', type: 'string'},
{name: 'mention_count', type: 'number'},
{name: 'unread_count', type: 'number'},
{name: 'url', type: 'string', isIndexed: true},
],
},
},
});
});
});