fix(client): store challenge panes sizes (#42519)

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
Victor Duarte
2021-06-17 13:20:39 -05:00
committed by GitHub
parent 3a8c1444eb
commit 310bbdf54b
4 changed files with 113 additions and 6 deletions

View File

@@ -0,0 +1,15 @@
import { isContained } from './is-contained';
describe('client/src isContained', () => {
it('returns true if `arr1` values are contained in `arr2`', () => {
const arr1 = ['dog', 'cat'];
const arr2 = ['cat', 'dog'];
expect(isContained(arr1, arr2)).toEqual(true);
});
it('returns true if `arr1` values are not contained in `arr2`', () => {
const arr1 = ['dog', 'cat'];
const arr2 = ['cat', 'monkey', 'bird'];
expect(isContained(arr1, arr2)).toEqual(false);
});
});

View File

@@ -0,0 +1,4 @@
// Performs a check if the items in `value` exist in `other`
export function isContained(value: string[], other: string[]): boolean {
return value.every(i => other.includes(i));
}