1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import collectionsReducer from "./collection-reducer";
6 import actions from "./collection-action";
8 describe('collection-reducer', () => {
9 it('should add new collection to the list', () => {
10 const initialState = undefined;
14 createdAt: '2018-01-01',
15 modifiedAt: '2018-01-01',
16 ownerUuid: 'owner-test123',
21 const state = collectionsReducer(initialState, actions.CREATE_COLLECTION(collection));
22 expect(state).toEqual([collection]);
25 it('should load collections', () => {
26 const initialState = undefined;
30 createdAt: '2018-01-01',
31 modifiedAt: '2018-01-01',
32 ownerUuid: 'owner-test123',
37 const collections = [collection, collection];
38 const state = collectionsReducer(initialState, actions.COLLECTIONS_SUCCESS({ collections }));
39 expect(state).toEqual([collection, collection]);