22229: Menu edits
[arvados.git] / services / workbench2 / src / views-components / context-menu / action-sets / project-action-set.cy.js
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 import { containsActionSubSet } from "../../../cypress/utils/contains-action-subset";
7
8 describe('project-action-set', () => {
9     const flattProjectActionSet = projectActionSet.reduce((prev, next) => prev.concat(next), []);
10     const flattReadOnlyProjectActionSet = readOnlyProjectActionSet.reduce((prev, next) => prev.concat(next), []);
11     const flattFilterGroupActionSet = filterGroupActionSet.reduce((prev, next) => prev.concat(next), []);
12
13     describe('projectActionSet', () => {
14         it('should not be empty', () => {
15             // then
16             expect(flattProjectActionSet).to.have.length.greaterThan(0);
17         });
18
19         it('should contain readOnlyProjectActionSet items', () => {
20             // then
21             expect(containsActionSubSet(flattProjectActionSet, flattReadOnlyProjectActionSet)).to.be.true;
22         })
23     });
24
25     describe('readOnlyProjectActionSet', () => {
26         it('should not be empty', () => {
27             // then
28             expect(flattReadOnlyProjectActionSet).to.have.length.greaterThan(0);
29         });
30
31         it('should not contain projectActionSet items', () => {
32             // then
33             expect(containsActionSubSet(flattReadOnlyProjectActionSet, flattProjectActionSet)).to.be.false;
34         })
35     });
36
37     describe('filterGroupActionSet', () => {
38         it('should not be empty', () => {
39             // then
40             expect(flattFilterGroupActionSet).to.have.length.greaterThan(0);
41         });
42
43         it('should not contain projectActionSet items', () => {
44             // then
45             expect(containsActionSubSet(flattFilterGroupActionSet, flattProjectActionSet)).to.be.false;
46         })
47     });
48 });