You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
session-desktop/ts/test/session/messages/SessionEstablishedMessage_t...

36 lines
1021 B
TypeScript

import { expect } from 'chai';
import { beforeEach } from 'mocha';
import { SessionEstablishedMessage } from '../../../session/messages/outgoing';
import { SignalService } from '../../../protobuf';
describe('SessionEstablishedMessage', () => {
let message: SessionEstablishedMessage;
beforeEach(() => {
const timestamp = Date.now();
message = new SessionEstablishedMessage({ timestamp });
});
it('has a nullMessage not null', () => {
const plainText = message.plainTextBuffer();
const decoded = SignalService.Content.decode(plainText);
expect(decoded.nullMessage).to.be.not.equal(
null,
'decoded.dataMessage.nullMessage should not be null'
);
});
it('ttl of 5 minutes', () => {
expect(message.ttl()).to.equal(5 * 60 * 1000);
});
it('has an identifier', () => {
expect(message.identifier).to.not.equal(null, 'identifier cannot be null');
expect(message.identifier).to.not.equal(
undefined,
'identifier cannot be undefined'
);
});
});