Change defaults for conversation title generation
This commit is contained in:
parent
6a165da589
commit
bd922433e3
14 changed files with 142 additions and 24 deletions
69
ts/test-node/sql/migration_990_test.ts
Normal file
69
ts/test-node/sql/migration_990_test.ts
Normal file
|
@ -0,0 +1,69 @@
|
|||
// Copyright 2023 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
import type { Database } from '@signalapp/better-sqlite3';
|
||||
import SQL from '@signalapp/better-sqlite3';
|
||||
|
||||
import { updateToVersion, insertData, getTableData } from './helpers';
|
||||
|
||||
describe('SQL/updateToSchemaVersion990', () => {
|
||||
let db: Database;
|
||||
|
||||
beforeEach(() => {
|
||||
db = new SQL(':memory:');
|
||||
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,
|
||||
},
|
||||
},
|
||||
]);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue