fix: make sure to use convo getters

instead of backbone get function
pull/2971/head
William Grant 2 years ago
parent d89741cb29
commit 06099966b0

@ -1,5 +1,6 @@
import autoBind from 'auto-bind';
import Backbone from 'backbone';
import { from_hex } from 'libsodium-wrappers-sumo';
import {
debounce,
includes,
@ -15,7 +16,6 @@ import {
uniq,
xor,
} from 'lodash';
import { from_hex } from 'libsodium-wrappers-sumo';
import { SignalService } from '../protobuf';
import { getMessageQueue } from '../session';
@ -118,8 +118,8 @@ import {
} from '../state/selectors/sogsRoomInfo'; // decide it it makes sense to move this to a redux slice?
import {
DisappearingMessageConversationModeType,
changeToDisappearingMessageType,
DisappearingMessageConversationModeType,
setExpirationStartTimestamp,
} from '../util/expiringMessages';
import { markAttributesAsReadIfNeeded } from './messageFactory';

@ -563,12 +563,12 @@ describe('Disappearing Messages', () => {
});
expect(updateSuccess, 'should be true').to.be.true;
expect(
conversation.get('expirationMode'),
conversation.getExpirationMode(),
'expirationMode should be deleteAfterSend'
).to.equal('deleteAfterSend');
expect(conversation.get('expireTimer'), 'expireTimer should be 5 minutes').to.equal(600);
expect(conversation.getExpireTimer(), 'expireTimer should be 5 minutes').to.equal(600);
expect(
conversation.get('lastDisappearingMessageChangeTimestamp'),
conversation.getLastDisappearingMessageChangeTimestamp(),
'lastDisappearingMessageChangeTimestamp should match the input value'
).to.equal(lastDisappearingMessageChangeTimestamp);
});

@ -271,11 +271,11 @@ describe('libsession_contacts', () => {
expect(
wrapperContact.expirationMode,
'expirationMode in the wrapper should match the inputted contact'
).to.equal(contact.get('expirationMode'));
).to.equal(contact.getExpirationMode());
expect(
wrapperContact.expirationTimerSeconds,
'expirationTimerSeconds in the wrapper should match the inputted contact'
).to.equal(contact.get('expireTimer'));
).to.equal(contact.getExpireTimer());
});
it('if disappearing messages is on then the wrapper returned values should match the inputted contact', async () => {
const contact = new ConversationModel({
@ -299,11 +299,11 @@ describe('libsession_contacts', () => {
expect(
wrapperContact.expirationMode,
'expirationMode in the wrapper should match the inputted contact'
).to.equal(contact.get('expirationMode'));
).to.equal(contact.getExpirationMode());
expect(
wrapperContact.expirationTimerSeconds,
'expirationTimerSeconds in the wrapper should match the inputted contact expireTimer'
).to.equal(contact.get('expireTimer'));
).to.equal(contact.getExpireTimer());
});
});
});

@ -216,7 +216,7 @@ describe('libsession_user_groups', () => {
expect(
wrapperGroup.disappearingTimerSeconds,
'disappearingTimerSeconds in the wrapper should match the inputted group'
).to.equal(group.get('expireTimer'));
).to.equal(group.getExpireTimer());
expect(
wrapperGroup.encPubkey.toString(),
'encPubkey in the wrapper should match the inputted group'
@ -257,7 +257,7 @@ describe('libsession_user_groups', () => {
expect(
wrapperGroup.disappearingTimerSeconds,
'disappearingTimerSeconds in the wrapper should match the inputted group expireTimer'
).to.equal(group.get('expireTimer'));
).to.equal(group.getExpireTimer());
});
});
});

@ -92,7 +92,7 @@ describe('libsession_user_profile', () => {
expect(
wrapperUserProfile.expirySeconds,
'expirySeconds in the wrapper should match the inputted user profile'
).to.equal(contact.get('expireTimer'));
).to.equal(contact.getExpireTimer());
});
it("returns an error if the inputted user profile isn't our conversation", async () => {
const contact = new ConversationModel({
@ -132,7 +132,7 @@ describe('libsession_user_profile', () => {
expect(
wrapperUserProfile.expirySeconds,
'expirySeconds in the wrapper should match the inputted user profile expireTimer'
).to.equal(contact.get('expireTimer'));
).to.equal(contact.getExpireTimer());
});
});
});

Loading…
Cancel
Save