Disable search keyboard shortcuts when main header isn't shown
This commit is contained in:
parent
011bdd2ae3
commit
eb203ba929
10 changed files with 166 additions and 70 deletions
|
@ -13,6 +13,8 @@ import {
|
|||
_getLeftPaneLists,
|
||||
getConversationSelector,
|
||||
getPlaceholderContact,
|
||||
getSelectedConversation,
|
||||
getSelectedConversationId,
|
||||
} from '../../../state/selectors/conversations';
|
||||
import { noopAction } from '../../../state/ducks/noop';
|
||||
import { StateType, reducer as rootReducer } from '../../../state/reducer';
|
||||
|
@ -446,4 +448,65 @@ describe('both/state/selectors/conversations', () => {
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('#getSelectedConversationId', () => {
|
||||
it('returns undefined if no conversation is selected', () => {
|
||||
const state = {
|
||||
...getEmptyRootState(),
|
||||
conversations: {
|
||||
...getEmptyState(),
|
||||
conversationLookup: {
|
||||
abc123: getDefaultConversation('abc123'),
|
||||
},
|
||||
},
|
||||
};
|
||||
assert.isUndefined(getSelectedConversationId(state));
|
||||
});
|
||||
|
||||
it('returns the selected conversation ID', () => {
|
||||
const state = {
|
||||
...getEmptyRootState(),
|
||||
conversations: {
|
||||
...getEmptyState(),
|
||||
conversationLookup: {
|
||||
abc123: getDefaultConversation('abc123'),
|
||||
},
|
||||
selectedConversationId: 'abc123',
|
||||
},
|
||||
};
|
||||
assert.strictEqual(getSelectedConversationId(state), 'abc123');
|
||||
});
|
||||
});
|
||||
|
||||
describe('#getSelectedConversation', () => {
|
||||
it('returns undefined if no conversation is selected', () => {
|
||||
const state = {
|
||||
...getEmptyRootState(),
|
||||
conversations: {
|
||||
...getEmptyState(),
|
||||
conversationLookup: {
|
||||
abc123: getDefaultConversation('abc123'),
|
||||
},
|
||||
},
|
||||
};
|
||||
assert.isUndefined(getSelectedConversation(state));
|
||||
});
|
||||
|
||||
it('returns the selected conversation ID', () => {
|
||||
const state = {
|
||||
...getEmptyRootState(),
|
||||
conversations: {
|
||||
...getEmptyState(),
|
||||
conversationLookup: {
|
||||
abc123: getDefaultConversation('abc123'),
|
||||
},
|
||||
selectedConversationId: 'abc123',
|
||||
},
|
||||
};
|
||||
assert.deepEqual(
|
||||
getSelectedConversation(state),
|
||||
getDefaultConversation('abc123')
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue