Stickers in storage service

This commit is contained in:
Fedor Indutny 2022-08-03 10:10:49 -07:00 committed by GitHub
parent d8a7e99c81
commit b47a906211
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 1216 additions and 80 deletions

View file

@ -2357,4 +2357,36 @@ describe('SQL migrations test', () => {
assert.strictEqual(payload.urgent, 1);
});
});
describe('updateToSchemaVersion65', () => {
it('initializes sticker pack positions', () => {
updateToVersion(64);
db.exec(
`
INSERT INTO sticker_packs
(id, key, lastUsed)
VALUES
("a", "key-1", 1),
("b", "key-2", 2),
("c", "key-3", 3);
`
);
updateToVersion(65);
assert.deepStrictEqual(
db
.prepare(
'SELECT id, position FROM sticker_packs ORDER BY position DESC'
)
.all(),
[
{ id: 'a', position: 2 },
{ id: 'b', position: 1 },
{ id: 'c', position: 0 },
]
);
});
});
});