Trim group titles when creating or editing
* Trim group titles when creating or editing * Trim title in more places
This commit is contained in:
parent
2cd29e1b63
commit
80e3582d01
3 changed files with 31 additions and 7 deletions
|
@ -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'));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue