Pressing Esc in left pane composer menu should go back

This commit is contained in:
Evan Hahn 2021-04-02 16:43:39 -05:00 committed by Josh Perez
parent 2d35fa8f57
commit f05d45ac9b
12 changed files with 168 additions and 5 deletions

View file

@ -2,6 +2,7 @@
// SPDX-License-Identifier: AGPL-3.0-only
import { assert } from 'chai';
import * as sinon from 'sinon';
import { v4 as uuid } from 'uuid';
import { RowType } from '../../../components/ConversationList';
@ -19,6 +20,25 @@ describe('LeftPaneSearchHelper', () => {
conversationId: uuid(),
});
describe('getBackAction', () => {
it('returns undefined; going back is handled elsewhere in the app', () => {
const helper = new LeftPaneSearchHelper({
conversationResults: { isLoading: false, results: [] },
contactResults: { isLoading: false, results: [] },
messageResults: { isLoading: false, results: [] },
searchTerm: 'foo',
});
assert.isUndefined(
helper.getBackAction({
showChooseGroupMembers: sinon.fake(),
showInbox: sinon.fake(),
startComposing: sinon.fake(),
})
);
});
});
describe('getRowCount', () => {
it('returns 0 when there are no search results', () => {
const helper = new LeftPaneSearchHelper({