Merge branch 'main' of git.arvados.org:arvados-workbench2 into 19079-search-results...
[arvados.git] / src / views-components / context-menu / action-sets / collection-action-set.test.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { collectionActionSet, readOnlyCollectionActionSet } from "./collection-action-set";
6
7 describe('collection-action-set', () => {
8     const flattCollectionActionSet = collectionActionSet.reduce((prev, next) => prev.concat(next), []);
9     const flattReadOnlyCollectionActionSet = readOnlyCollectionActionSet.reduce((prev, next) => prev.concat(next), []);
10     describe('collectionActionSet', () => {
11         it('should not be empty', () => {
12             // then
13             expect(flattCollectionActionSet.length).toBeGreaterThan(0);
14         });
15
16         it('should contain readOnlyCollectionActionSet items', () => {
17             // then
18             expect(flattCollectionActionSet)
19                 .toEqual(expect.arrayContaining(flattReadOnlyCollectionActionSet));
20         })
21     });
22
23     describe('readOnlyCollectionActionSet', () => {
24         it('should not be empty', () => {
25             // then
26             expect(flattReadOnlyCollectionActionSet.length).toBeGreaterThan(0);
27         });
28
29         it('should not contain collectionActionSet items', () => {
30             // then
31             expect(flattReadOnlyCollectionActionSet)
32                 .not.toEqual(expect.arrayContaining(flattCollectionActionSet));
33         })
34     });
35 });