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',
21 const state = projectsReducer(initialState, actions.CREATE_PROJECT(project));
22 expect(state).toEqual([project]);
25 it('should load projects', () => {
26 const initialState = undefined;
30 createdAt: '2018-01-01',
31 modifiedAt: '2018-01-01',
32 ownerUuid: 'owner-test123',
37 const projects = [project, project];
38 const state = projectsReducer(initialState, actions.PROJECTS_SUCCESS({projects, parentItemId: undefined}));
39 expect(state).toEqual([{