aboutsummaryrefslogtreecommitdiffstats
path: root/test/helpers/array-helpers.test.ts
blob: e8060c2c4e408430ac0a057ecba24822c8af8914 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { shuffleArray } from '../../src/helpers/array-helpers';

describe('array_helpers', () => {
  it('isValidExternalURL', () => {
    const originalArray = ['a', 'b', 'c'];
    const shuffledArray = shuffleArray(originalArray);

    // Expect the arrays to not be exactly the same
    expect(shuffledArray).not.toEqual(originalArray);

    // Expect the arrays to be exactly the same
    // when both are sorted alphabetically
    expect(shuffledArray.sort()).toEqual(originalArray.sort());
  });
});