16437: Removes context items when projects are not editable by user
[arvados-workbench2.git] / src / views-components / context-menu / action-sets / collection-action-set.test.ts
diff --git a/src/views-components/context-menu/action-sets/collection-action-set.test.ts b/src/views-components/context-menu/action-sets/collection-action-set.test.ts
new file mode 100644 (file)
index 0000000..9182f3f
--- /dev/null
@@ -0,0 +1,35 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { collectionActionSet, readOnlyCollectionActionSet } from "./collection-action-set";
+
+describe('collection-action-set', () => {
+    const flattCollectionActionSet = collectionActionSet.reduce((prev, next) => prev.concat(next), []);
+    const flattReadOnlyCollectionActionSet = readOnlyCollectionActionSet.reduce((prev, next) => prev.concat(next), []);
+    describe('collectionActionSet', () => {
+        it('should not be empty', () => {
+            // then
+            expect(flattCollectionActionSet.length).toBeGreaterThan(0);
+        });
+
+        it('should contain readOnlyCollectionActionSet items', () => {
+            // then
+            expect(flattCollectionActionSet)
+                .toEqual(expect.arrayContaining(flattReadOnlyCollectionActionSet));
+        })
+    });
+
+    describe('readOnlyCollectionActionSet', () => {
+        it('should not be empty', () => {
+            // then
+            expect(flattReadOnlyCollectionActionSet.length).toBeGreaterThan(0);
+        });
+
+        it('should not contain collectionActionSet items', () => {
+            // then
+            expect(flattReadOnlyCollectionActionSet)
+                .not.toEqual(expect.arrayContaining(flattCollectionActionSet));
+        })
+    });
+});
\ No newline at end of file