1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-11-01 19:07:38 +01:00
unleash.unleash/src/lib/util/arraysHaveSameItems.test.ts
olav 8c1d4838b8
fix: require equal environments when moving toggles (#1595)
* fix: apply query from checkProjectsCompatibility

* fix: require equal environments when moving toggles

* refactor: clean up project service tests

* refactor: add test for project compatibility check

* refactor: improve arraysHaveSameItems name
2022-05-18 11:07:01 +02:00

18 lines
909 B
TypeScript

import { arraysHaveSameItems } from './arraysHaveSameItems';
test('arraysHaveSameItems', () => {
expect(arraysHaveSameItems([], [])).toEqual(true);
expect(arraysHaveSameItems([1], [1])).toEqual(true);
expect(arraysHaveSameItems([1], [1, 1])).toEqual(true);
expect(arraysHaveSameItems([1, 1], [1])).toEqual(true);
expect(arraysHaveSameItems([1, 2], [1, 2])).toEqual(true);
expect(arraysHaveSameItems([1, 2], [2, 1])).toEqual(true);
expect(arraysHaveSameItems([1, 2], [2, 2, 1])).toEqual(true);
expect(arraysHaveSameItems([1], [])).toEqual(false);
expect(arraysHaveSameItems([1], [2])).toEqual(false);
expect(arraysHaveSameItems([1, 2], [1, 3])).toEqual(false);
expect(arraysHaveSameItems([1, 2], [1, 2, 3])).toEqual(false);
expect(arraysHaveSameItems([1, 2, 3], [1, 2])).toEqual(false);
expect(arraysHaveSameItems([1, 2, 3], [1, 2, 4])).toEqual(false);
});