X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/efcea950b84b26c4cbbdf4df8fd5c88f6c846da9..72ed766fa1a94853a1c57d0f43390a81e3d92c90:/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 index 00000000..9182f3f2 --- /dev/null +++ b/src/views-components/context-menu/action-sets/collection-action-set.test.ts @@ -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