import { RouterTestingModule } from '@angular/router/testing';
import { BreadcrumbService } from '@core/breadcrumb';
import { Spectator, createComponentFactory } from '@ngneat/spectator';
import { ShellBreadcrumbComponent } from '@shell/breadcrumb';
import { UiIconModule } from '@ui/icon';
import { MockComponent } from 'ng-mocks';
import { GoodsInComponent } from './goods-in.component';

describe('GoodsInComponent', () => {
  let spectator: Spectator<GoodsInComponent>;
  let breadcrumbServiceMock = {
    addBreadcrumbIfNotExists: jasmine.createSpy(),
  };

  const createComponent = createComponentFactory({
    component: GoodsInComponent,
    imports: [RouterTestingModule, UiIconModule],
    declarations: [MockComponent(ShellBreadcrumbComponent)],
  });

  beforeEach(async () => {
    spectator = createComponent({
      providers: [{ provide: BreadcrumbService, useValue: breadcrumbServiceMock }],
    });
  });

  // it('should create', () => {
  //   expect(spectator.component).toBeTruthy();
  // });

  // describe('ngOnInit', () => {
  //   it('should call BreadcrumbService.addBreadcrumbIfNotExists', () => {
  //     expect(breadcrumbServiceMock.addBreadcrumbIfNotExists).toHaveBeenCalled();
  //   });
  // });

  // describe('shell-breadcrumb', () => {
  //   it('should render', () => {
  //     expect(spectator.query('shell-breadcrumb')).toBeVisible();
  //   });
  // });
});
