import { ComponentFixture, TestBed } from '@angular/core/testing';
import { UiSelectFilterComponent } from './select-filter.component';
import { UiSelectFilterOptionComponent } from './select-filter-option.component';
import { NO_ERRORS_SCHEMA } from '@angular/core';

fdescribe('SelectFilterComponent', () => {
  let fixture: ComponentFixture<UiSelectFilterComponent>;
  let component: UiSelectFilterComponent;

  beforeEach(async () => {
    TestBed.configureTestingModule({
      providers: [],
      declarations: [UiSelectFilterComponent, UiSelectFilterOptionComponent],
      schemas: [NO_ERRORS_SCHEMA],
    }).compileComponents();
  });

  beforeEach(() => {
    fixture = TestBed.createComponent(UiSelectFilterComponent);
    component = fixture.componentInstance;

    spyOn(component, 'ngAfterViewInit').and.callFake(() => {});
    fixture.detectChanges();
  });

  describe('setAllSelected', () => {
    beforeEach(() => {
      spyOn(component, 'setAllSelected').and.callThrough();
      spyOn(component.allSelected$, 'next').and.callFake(() => {});
    });

    // it('should set allSelected with true', () => {
    //   const mockFilters = selectFilterOptionsAllSelected;
    //   component.setAllSelected(mockFilters);

    //   expect(component.allSelected$.next).toHaveBeenCalledWith(true);
    // });

    // it('should set allSelected to false if only some options are selected', () => {
    //   const mockFilters = selectFilterOptionsMixedSelected;
    //   component.setAllSelected(mockFilters);

    //   expect(component.allSelected$.next).toHaveBeenCalledWith(false);
    // });

    // it('should set allSelected with false', () => {
    //   const mockFilters = selectFilterOptionsAllDeselected;
    //   component.setAllSelected(mockFilters);

    //   expect(component.allSelected$.next).toHaveBeenCalledWith(false);
    // });
  });
});
