mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 04:09:49 +00:00
Rename files
This commit is contained in:
73
ts/test-node/sql/migration_990_test.node.ts
Normal file
73
ts/test-node/sql/migration_990_test.node.ts
Normal file
@@ -0,0 +1,73 @@
|
||||
// Copyright 2023 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import type { WritableDB } from '../../sql/Interface.std.js';
|
||||
import {
|
||||
createDB,
|
||||
updateToVersion,
|
||||
insertData,
|
||||
getTableData,
|
||||
} from './helpers.node.js';
|
||||
|
||||
describe('SQL/updateToSchemaVersion990', () => {
|
||||
let db: WritableDB;
|
||||
|
||||
beforeEach(() => {
|
||||
db = createDB();
|
||||
updateToVersion(db, 980);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
db.close();
|
||||
});
|
||||
|
||||
it('should migrate conversations', () => {
|
||||
insertData(db, 'conversations', [
|
||||
{
|
||||
id: 'no-prop',
|
||||
json: {
|
||||
keep: 'this',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'false-prop',
|
||||
json: {
|
||||
keep: 'this',
|
||||
notSharingPhoneNumber: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'true-prop',
|
||||
json: {
|
||||
keep: 'this',
|
||||
notSharingPhoneNumber: true,
|
||||
},
|
||||
},
|
||||
]);
|
||||
updateToVersion(db, 990);
|
||||
assert.deepStrictEqual(getTableData(db, 'conversations'), [
|
||||
{
|
||||
id: 'no-prop',
|
||||
json: {
|
||||
keep: 'this',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'false-prop',
|
||||
json: {
|
||||
keep: 'this',
|
||||
sharingPhoneNumber: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'true-prop',
|
||||
json: {
|
||||
keep: 'this',
|
||||
sharingPhoneNumber: false,
|
||||
},
|
||||
},
|
||||
]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user