mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-26 21:28:40 +00:00
Trim group titles when creating or editing
* Trim group titles when creating or editing * Trim title in more places
This commit is contained in:
@@ -743,6 +743,28 @@ describe('both/state/ducks/conversations', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("trims the group's title before calling groups.createGroupV2", async () => {
|
||||
await createGroup()(
|
||||
sinon.spy(),
|
||||
() => ({
|
||||
...getEmptyRootState(),
|
||||
conversations: {
|
||||
...conversationsState,
|
||||
composer: {
|
||||
...conversationsState.composer,
|
||||
groupName: ' To Trim \t',
|
||||
},
|
||||
},
|
||||
}),
|
||||
null
|
||||
);
|
||||
|
||||
sinon.assert.calledWith(
|
||||
createGroupStub,
|
||||
sinon.match({ name: 'To Trim' })
|
||||
);
|
||||
});
|
||||
|
||||
it('dispatches a CREATE_GROUP_REJECTED action if group creation fails, which marks the state with an error', async () => {
|
||||
createGroupStub.rejects(new Error('uh oh'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user