refactor: rename generateDisappearingMessage

to generateDisappearingVisibleMessage
pull/2971/head
William Grant 2 years ago
parent 6941682173
commit bf5bcae4ac

@ -2,7 +2,7 @@ import chai, { expect } from 'chai';
import Sinon from 'sinon'; import Sinon from 'sinon';
import chaiAsPromised from 'chai-as-promised'; import chaiAsPromised from 'chai-as-promised';
import { import {
generateDisappearingMessage, generateDisappearingVisibleMessage,
generateVisibleMessage, generateVisibleMessage,
stubWindowLog, stubWindowLog,
} from '../../../test-utils/utils'; } from '../../../test-utils/utils';
@ -362,7 +362,7 @@ describe('Disappearing Messages', () => {
expect(expireUpdate?.isOutdated, 'isOutdated should be undefined').to.be.undefined; expect(expireUpdate?.isOutdated, 'isOutdated should be undefined').to.be.undefined;
}); });
it('if we receive a deleteAfterRead message after 1 minute then it returns those values', async () => { it('if we receive a deleteAfterRead message after 1 minute then it returns those values', async () => {
const disappearingMessage = generateDisappearingMessage({ const disappearingMessage = generateDisappearingVisibleMessage({
expirationType: 'deleteAfterRead', expirationType: 'deleteAfterRead',
expireTimer: 60, expireTimer: 60,
}); });
@ -397,7 +397,7 @@ describe('Disappearing Messages', () => {
}); });
it('if we receive an ExpirationTimerUpdate message for deleteAfterSend after 5 minutes then it returns those values', async () => { it('if we receive an ExpirationTimerUpdate message for deleteAfterSend after 5 minutes then it returns those values', async () => {
const lastDisappearingMessageChangeTimestamp = GetNetworkTime.getNowWithNetworkOffset(); const lastDisappearingMessageChangeTimestamp = GetNetworkTime.getNowWithNetworkOffset();
const expirationTimerUpdateMessage = generateDisappearingMessage({ const expirationTimerUpdateMessage = generateDisappearingVisibleMessage({
expirationType: 'deleteAfterSend', expirationType: 'deleteAfterSend',
expireTimer: 300, expireTimer: 300,
expirationTimerUpdate: { expirationTimerUpdate: {
@ -438,7 +438,7 @@ describe('Disappearing Messages', () => {
}); });
it('if we receive an outdated ExpirationTimerUpdate message then it should be ignored and is outdated', async () => { it('if we receive an outdated ExpirationTimerUpdate message then it should be ignored and is outdated', async () => {
const lastDisappearingMessageChangeTimestamp = GetNetworkTime.getNowWithNetworkOffset(); const lastDisappearingMessageChangeTimestamp = GetNetworkTime.getNowWithNetworkOffset();
const expirationTimerUpdateMessage = generateDisappearingMessage({ const expirationTimerUpdateMessage = generateDisappearingVisibleMessage({
expirationType: 'deleteAfterSend', expirationType: 'deleteAfterSend',
expireTimer: 300, expireTimer: 300,
expirationTimerUpdate: { expirationTimerUpdate: {
@ -571,7 +571,6 @@ describe('Disappearing Messages', () => {
'lastDisappearingMessageChangeTimestamp should match the input value' 'lastDisappearingMessageChangeTimestamp should match the input value'
).to.equal(lastDisappearingMessageChangeTimestamp); ).to.equal(lastDisappearingMessageChangeTimestamp);
}); });
// TODO Continue
}); });
}); });

@ -123,7 +123,7 @@ export function generateFakeIncomingOpenGroupMessageV4({
}; };
} }
export function generateDisappearingMessage({ export function generateDisappearingVisibleMessage({
identifier, identifier,
timestamp, timestamp,
expirationType, expirationType,

Loading…
Cancel
Save