1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { filterGroupActionSet, projectActionSet, readOnlyProjectActionSet } from "./project-action-set";
6 import { containsActionSubSet } from "../../../cypress/utils/contains-action-subset";
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), []);
13 describe('projectActionSet', () => {
14 it('should not be empty', () => {
16 expect(flattProjectActionSet).to.have.length.greaterThan(0);
19 it('should contain readOnlyProjectActionSet items', () => {
21 expect(containsActionSubSet(flattProjectActionSet, flattReadOnlyProjectActionSet)).to.be.true;
25 describe('readOnlyProjectActionSet', () => {
26 it('should not be empty', () => {
28 expect(flattReadOnlyProjectActionSet).to.have.length.greaterThan(0);
31 it('should not contain projectActionSet items', () => {
33 expect(containsActionSubSet(flattReadOnlyProjectActionSet, flattProjectActionSet)).to.be.false;
37 describe('filterGroupActionSet', () => {
38 it('should not be empty', () => {
40 expect(flattFilterGroupActionSet).to.have.length.greaterThan(0);
43 it('should not contain projectActionSet items', () => {
45 expect(containsActionSubSet(flattFilterGroupActionSet, flattProjectActionSet)).to.be.false;