Add utils for recognizing resource by uuid
[arvados-workbench2.git] / src / store / side-panel / side-panel-reducer.test.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { sidePanelReducer } from "./side-panel-reducer";
6 import { sidePanelActions } from "./side-panel-action";
7 import { ProjectsIcon } from "~/components/icon/icon";
8
9 describe('side-panel-reducer', () => {
10     it('should open side-panel item', () => {
11         const initialState = [
12             {
13                 id: "1",
14                 name: "Projects",
15                 url: "/projects",
16                 icon: ProjectsIcon,
17                 open: false
18             }
19         ];
20         const project = [
21             {
22                 id: "1",
23                 name: "Projects",
24                 icon: ProjectsIcon,
25                 open: true,
26                 url: "/projects"
27             }
28         ];
29
30         const state = sidePanelReducer(initialState, sidePanelActions.TOGGLE_SIDE_PANEL_ITEM_OPEN(initialState[0].id));
31         expect(state).toEqual(project);
32     });
33 });