summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/array.pipe.spec.ts
blob: 610e22c4397ee6103889aa957b73ec926e286737 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { ArrayPipe } from './array.pipe';

describe('ArrayPipe', () => {
  const pipe = new ArrayPipe();

  it('create an instance', () => {
    expect(pipe).toBeTruthy();
  });

  it('transforms string to array', () => {
    expect(pipe.transform('foo')).toStrictEqual(['foo']);
  });

  it('transforms array to array', () => {
    expect(pipe.transform(['foo'], true)).toStrictEqual([['foo']]);
  });

  it('do not transforms array to array', () => {
    expect(pipe.transform(['foo'])).toStrictEqual(['foo']);
  });
});