Profile name spoofing dialog

This commit is contained in:
Evan Hahn 2021-04-21 11:31:12 -05:00 committed by Scott Nonnenberg
parent 814255c10e
commit e7ef3de6d0
21 changed files with 893 additions and 15 deletions

View file

@ -31,6 +31,7 @@ const {
clearGroupCreationError,
clearInvitedConversationsForNewlyCreatedGroup,
closeCantAddContactToGroupModal,
closeContactSpoofingReview,
closeMaximumGroupSizeModal,
closeRecommendedGroupSizeModal,
createGroup,
@ -47,6 +48,7 @@ const {
startComposing,
showChooseGroupMembers,
startSettingGroupMetadata,
reviewMessageRequestNameCollision,
toggleConversationInChooseMembers,
} = actions;
@ -550,6 +552,29 @@ describe('both/state/ducks/conversations', () => {
});
});
describe('CLOSE_CONTACT_SPOOFING_REVIEW', () => {
it('closes the contact spoofing review modal if it was open', () => {
const state = {
...getEmptyState(),
contactSpoofingReview: {
safeConversationId: 'abc123',
},
};
const action = closeContactSpoofingReview();
const actual = reducer(state, action);
assert.isUndefined(actual.contactSpoofingReview);
});
it("does nothing if the modal wasn't already open", () => {
const state = getEmptyState();
const action = closeContactSpoofingReview();
const actual = reducer(state, action);
assert.deepEqual(actual, state);
});
});
describe('CLOSE_MAXIMUM_GROUP_SIZE_MODAL', () => {
it('closes the maximum group size modal if it was open', () => {
const state = {
@ -1151,6 +1176,20 @@ describe('both/state/ducks/conversations', () => {
});
});
describe('REVIEW_MESSAGE_REQUEST_NAME_COLLISION', () => {
it('starts reviewing a message request name collision', () => {
const state = getEmptyState();
const action = reviewMessageRequestNameCollision({
safeConversationId: 'def',
});
const actual = reducer(state, action);
assert.deepEqual(actual.contactSpoofingReview, {
safeConversationId: 'def',
});
});
});
describe('SET_COMPOSE_GROUP_AVATAR', () => {
it("can clear the composer's group avatar", () => {
const state = {