mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-07-18 19:12:17 +01:00
Init @signalapp/types package
Co-authored-by: Jamie <113370520+jamiebuilds-signal@users.noreply.github.com>
This commit is contained in:
@@ -15,6 +15,7 @@ import type {
|
||||
PinnedMessage,
|
||||
PinnedMessageParams,
|
||||
} from '../../../types/PinnedMessage.std.ts';
|
||||
import { TimestampMs } from '@signalapp/types';
|
||||
|
||||
function setupData(db: WritableDB) {
|
||||
insertData(db, 'conversations', [{ id: 'c1' }, { id: 'c2' }]);
|
||||
@@ -39,8 +40,8 @@ function getParams(
|
||||
return {
|
||||
messageId,
|
||||
conversationId,
|
||||
pinnedAt,
|
||||
expiresAt,
|
||||
pinnedAt: TimestampMs.fromNumber(pinnedAt),
|
||||
expiresAt: expiresAt != null ? TimestampMs.fromNumber(expiresAt) : null,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -131,7 +132,7 @@ describe('sql/server/pinnedMessages', () => {
|
||||
const pin1 = getParams('c1', 'c1-m1', 1);
|
||||
const pin2 = getParams('c1', 'c1-m2', 2);
|
||||
const pin3 = getParams('c1', 'c1-m3', 3);
|
||||
const updated = { ...pin3, pinnedAt: 4 };
|
||||
const updated = { ...pin3, pinnedAt: TimestampMs.fromNumber(4) };
|
||||
|
||||
const row1 = expectInserted(appendPinnedMessage(db, 3, pin1));
|
||||
const row2 = expectInserted(appendPinnedMessage(db, 3, pin2));
|
||||
|
||||
Reference in New Issue
Block a user