1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { collectionCreationReducer } from "./collection-creator-reducer";
6 import { collectionCreateActions } from "./collection-creator-action";
8 describe('collection-reducer', () => {
10 it('should open collection creator dialog', () => {
11 const initialState = {
12 creator: { opened: false, ownerUuid: "" }
15 creator: { opened: true, ownerUuid: "" },
18 const state = collectionCreationReducer(initialState, collectionCreateActions.OPEN_COLLECTION_CREATOR(initialState.creator));
19 expect(state).toEqual(collection);
22 it('should close collection creator dialog', () => {
23 const initialState = {
24 creator: { opened: true, ownerUuid: "" }
27 creator: { opened: false, ownerUuid: "" },
30 const state = collectionCreationReducer(initialState, collectionCreateActions.CLOSE_COLLECTION_CREATOR());
31 expect(state).toEqual(collection);
34 it('should reset collection creator dialog props', () => {
35 const initialState = {
36 creator: { opened: true, ownerUuid: "test" }
39 creator: { opened: false, ownerUuid: "" },
42 const state = collectionCreationReducer(initialState, collectionCreateActions.CREATE_COLLECTION_SUCCESS());
43 expect(state).toEqual(collection);