Assume everyone is GV2-capable

This commit is contained in:
Evan Hahn 2022-03-04 13:48:44 -06:00 committed by GitHub
parent 0a52318be6
commit effe5aae6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 16 additions and 405 deletions

View file

@ -1,4 +1,4 @@
// Copyright 2021 Signal Messenger, LLC
// Copyright 2021-2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { ComposerStep } from '../../state/ducks/conversationsEnums';
@ -13,7 +13,6 @@ export const defaultStartDirectConversationComposerState = {
export const defaultChooseGroupMembersComposerState = {
step: ComposerStep.ChooseGroupMembers as const,
searchTerm: '',
cantAddContactIdForModal: undefined,
groupAvatar: undefined,
groupName: '',
groupExpireTimer: 0,

View file

@ -1,4 +1,4 @@
// Copyright 2020-2021 Signal Messenger, LLC
// Copyright 2020-2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { v4 as generateUuid } from 'uuid';
@ -330,7 +330,6 @@ export function getDefaultConversation(
color: getRandomColor(),
firstName,
id: generateUuid(),
isGroupV2Capable: true,
isMe: false,
lastUpdated: Date.now(),
markedUnread: Boolean(overrideProps.markedUnread),

View file

@ -18,7 +18,6 @@ import {
_getLeftPaneLists,
getAllComposableConversations,
getCandidateContactsForNewGroup,
getCantAddContactForModal,
getComposableContacts,
getComposableGroups,
getComposeGroupAvatar,
@ -1162,53 +1161,6 @@ describe('both/state/selectors/conversations', () => {
});
});
describe('#getCantAddContactForModal', () => {
it('returns undefined if not in the "choose group members" composer step', () => {
assert.isUndefined(getCantAddContactForModal(getEmptyRootState()));
assert.isUndefined(
getCantAddContactForModal({
...getEmptyRootState(),
conversations: {
...getEmptyState(),
composer: defaultStartDirectConversationComposerState,
},
})
);
});
it("returns undefined if there's no contact marked", () => {
assert.isUndefined(
getCantAddContactForModal({
...getEmptyRootState(),
conversations: {
...getEmptyState(),
composer: defaultChooseGroupMembersComposerState,
},
})
);
});
it('returns the marked contact', () => {
const conversation = makeConversation('abc123');
assert.deepEqual(
getCantAddContactForModal({
...getEmptyRootState(),
conversations: {
...getEmptyState(),
conversationLookup: { abc123: conversation },
composer: {
...defaultChooseGroupMembersComposerState,
cantAddContactIdForModal: 'abc123',
},
},
}),
conversation
);
});
});
describe('#getComposerConversationSearchTerm', () => {
it("returns the composer's contact search term", () => {
assert.strictEqual(