import { HasSelectedFiltersPipe } from './has-selected-filters.pipe';
import { filters } from '../mocks';

fdescribe('Pipe: HasSelectedFiltersPipe', () => {
  let pipe: HasSelectedFiltersPipe;

  beforeEach(() => {
    pipe = new HasSelectedFiltersPipe();
  });

  it('should return true', () => {
    const filterWithSelected = filters;

    const result = pipe.transform(filterWithSelected);
    expect(result).toBeTruthy();
  });

  it('should return false', () => {
    const filterWithSelected = filters.map((f) => ({
      ...f,
      options: f.options.map((o) => ({ ...o, selected: false })),
    }));

    const result = pipe.transform(filterWithSelected);
    expect(result).toBeFalsy();
  });
});
