This repository has been archived by the owner on Mar 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
/
rhs.test.js
44 lines (36 loc) · 1.4 KB
/
rhs.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import assert from 'assert';
import * as Selectors from 'selectors/rhs';
describe('Selectors.Rhs', () => {
describe('should return the last time a post was selected', () => {
[0, 1000000, 2000000].forEach((expected) => {
it(`when open is ${expected}`, () => {
const state = {views: {rhs: {
selectedPostFocussedAt: expected,
}}};
assert.deepEqual(expected, Selectors.getSelectedPostFocussedAt(state));
});
});
});
describe('should return the open state of the sidebar', () => {
[true, false].forEach((expected) => {
it(`when open is ${expected}`, () => {
const state = {views: {rhs: {
isSidebarOpen: expected,
}}};
assert.deepEqual(expected, Selectors.getIsRhsOpen(state));
});
});
});
describe('should return the open state of the sidebar menu', () => {
[true, false].forEach((expected) => {
it(`when open is ${expected}`, () => {
const state = {views: {rhs: {
isMenuOpen: expected,
}}};
assert.deepEqual(expected, Selectors.getIsRhsMenuOpen(state));
});
});
});
});