Introduce a new design for the left pane

This commit is contained in:
Evan Hahn 2021-10-12 18:59:08 -05:00 committed by GitHub
parent d60600d6fb
commit 35a54cdc02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
63 changed files with 1205 additions and 576 deletions

View file

@ -5,6 +5,7 @@ import { assert } from 'chai';
import {
getEmojiSkinTone,
getPinnedConversationIds,
getPreferredLeftPaneWidth,
getPreferredReactionEmoji,
} from '../../../state/selectors/items';
import type { StateType } from '../../../state/reducer';
@ -50,6 +51,32 @@ describe('both/state/selectors/items', () => {
});
});
describe('#getPreferredLeftPaneWidth', () => {
it('returns a default if no value is present', () => {
const state = getRootState({});
assert.strictEqual(getPreferredLeftPaneWidth(state), 320);
});
it('returns a default value if passed something invalid', () => {
[undefined, null, '250', [250], 250.123].forEach(
preferredLeftPaneWidth => {
const state = getRootState({
// eslint-disable-next-line @typescript-eslint/no-explicit-any
preferredLeftPaneWidth: preferredLeftPaneWidth as any,
});
assert.strictEqual(getPreferredLeftPaneWidth(state), 320);
}
);
});
it('returns the value in storage if it is valid', () => {
const state = getRootState({
preferredLeftPaneWidth: 345,
});
assert.strictEqual(getPreferredLeftPaneWidth(state), 345);
});
});
describe('#getPinnedConversationIds', () => {
it('returns pinnedConversationIds key from items', () => {
const expected = ['one', 'two'];