Merge branch '21705-go-deps-update-all'
[arvados.git] / services / workbench2 / src / views-components / context-menu / action-sets / project-action-set.test.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { filterGroupActionSet, projectActionSet, readOnlyProjectActionSet } from "./project-action-set";
6
7 describe('project-action-set', () => {
8     const flattProjectActionSet = projectActionSet.reduce((prev, next) => prev.concat(next), []);
9     const flattReadOnlyProjectActionSet = readOnlyProjectActionSet.reduce((prev, next) => prev.concat(next), []);
10     const flattFilterGroupActionSet = filterGroupActionSet.reduce((prev, next) => prev.concat(next), []);
11
12     describe('projectActionSet', () => {
13         it('should not be empty', () => {
14             // then
15             expect(flattProjectActionSet.length).toBeGreaterThan(0);
16         });
17
18         it('should contain readOnlyProjectActionSet items', () => {
19             // then
20             expect(flattProjectActionSet)
21                 .toEqual(expect.arrayContaining(flattReadOnlyProjectActionSet));
22         })
23     });
24
25     describe('readOnlyProjectActionSet', () => {
26         it('should not be empty', () => {
27             // then
28             expect(flattReadOnlyProjectActionSet.length).toBeGreaterThan(0);
29         });
30
31         it('should not contain projectActionSet items', () => {
32             // then
33             expect(flattReadOnlyProjectActionSet)
34                 .not.toEqual(expect.arrayContaining(flattProjectActionSet));
35         })
36     });
37
38     describe('filterGroupActionSet', () => {
39         it('should not be empty', () => {
40             // then
41             expect(flattFilterGroupActionSet.length).toBeGreaterThan(0);
42         });
43
44         it('should not contain projectActionSet items', () => {
45             // then
46             expect(flattFilterGroupActionSet)
47                 .not.toEqual(expect.arrayContaining(flattProjectActionSet));
48         })
49     });
50 });