feat: Add reply editor mode to the store (#7515)
This commit is contained in:
@@ -51,4 +51,26 @@ describe('#actions', () => {
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#setReplyEditorMode', () => {
|
||||
it('sends correct actions', async () => {
|
||||
await actions.setReplyEditorMode(
|
||||
{
|
||||
commit,
|
||||
state: {
|
||||
draftMessages: {},
|
||||
},
|
||||
},
|
||||
{ mode: 'reply' }
|
||||
);
|
||||
expect(commit.mock.calls).toEqual([
|
||||
[
|
||||
types.SET_REPLY_EDITOR_MODE,
|
||||
{
|
||||
mode: 'reply',
|
||||
},
|
||||
],
|
||||
]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -15,4 +15,11 @@ describe('#getters', () => {
|
||||
};
|
||||
expect(getters.get(state)('draft-22-REPLY')).toEqual('');
|
||||
});
|
||||
|
||||
it('return replyEditorMode', () => {
|
||||
const state = {
|
||||
replyEditorMode: 'reply',
|
||||
};
|
||||
expect(getters.getReplyEditorMode(state)).toEqual('reply');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -30,4 +30,16 @@ describe('#mutations', () => {
|
||||
expect(state.records).toEqual({});
|
||||
});
|
||||
});
|
||||
|
||||
describe('#SET_REPLY_EDITOR_MODE', () => {
|
||||
it('sets the reply editor mode', () => {
|
||||
const state = {
|
||||
replyEditorMode: 'reply',
|
||||
};
|
||||
mutations[types.SET_REPLY_EDITOR_MODE](state, {
|
||||
mode: 'note',
|
||||
});
|
||||
expect(state.replyEditorMode).toEqual('note');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user