1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import projectsReducer from "./project-reducer";
6 import actions from "./project-action";
8 describe('project-reducer', () => {
9 it('should add new project to the list', () => {
10 const initialState = undefined;
14 createdAt: '2018-01-01',
15 modifiedAt: '2018-01-01',
16 ownerUuid: 'owner-test123',
20 const state = projectsReducer(initialState, actions.CREATE_PROJECT(project));
21 expect(state).toEqual([project]);
24 it('should load projects', () => {
25 const initialState = undefined;
29 createdAt: '2018-01-01',
30 modifiedAt: '2018-01-01',
31 ownerUuid: 'owner-test123',
35 const projects = [project, project];
36 const state = projectsReducer(initialState, actions.PROJECTS_SUCCESS({projects, parentItemId: undefined}));
37 expect(state).toEqual([{