// import { fakeAsync } from '@angular/core/testing';
// import { ProductImagePipe } from '@cdn/product-image';
// import { createComponentFactory, Spectator } from '@ngneat/spectator';
// import { MathPipesModule } from '@shared/pipes/math';
// import { ArrivalStatus } from '@generated/swagger/wws-api';
// import { UiCommonModule } from '@ui/common';
// import { UiTooltipModule } from '@ui/tooltip';
// import { MockPipe, MockService } from 'ng-mocks';
// import { BehaviorSubject, NEVER, of } from 'rxjs';
// import { PackageDetailsListItemComponent } from './package-details-list-item.component';
// import { PackageDetailsListStore } from './package-details-list.store';

// describe('PackageDetailsListItemComponent', () => {
//   let spectator: Spectator<PackageDetailsListItemComponent>;
//   let storeMock: PackageDetailsListStore;
//   let arrivalStatusSubject: BehaviorSubject<ArrivalStatus>;

//   const createComponent = createComponentFactory({
//     component: PackageDetailsListItemComponent,
//     imports: [UiCommonModule, UiTooltipModule, MathPipesModule],
//     declarations: [MockPipe(ProductImagePipe, (value) => `base/karma/assets/unit-test.svg#${value}`)],
//   });

//   beforeEach(() => {
//     arrivalStatusSubject = new BehaviorSubject(0);
//     storeMock = MockService(PackageDetailsListStore, {
//       arrivalStatus$: arrivalStatusSubject.asObservable(),
//       getCompartmentByEan$: (ean: string) => NEVER,
//       getInStockByEan$: (ean: string) => NEVER,
//     });
//     spectator = createComponent({
//       providers: [{ provide: PackageDetailsListStore, useValue: storeMock }],
//     });
//   });

//   afterEach(() => {
//     arrivalStatusSubject.complete();
//   });

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

//   describe('.package-details-list-item__product-image', () => {
//     it('should display product image', () => {
//       spectator.setInput({
//         item: { id: '', isPrebooked: false, product: { ean: 'test-ean' }, stockInfos: [] },
//       });

//       expect(spectator.query('.package-details-list-item__product-image')).toHaveAttribute(
//         'src',
//         'base/karma/assets/unit-test.svg#test-ean',
//       );
//     });

//     it('should have the alt-attirbute set to "test-alt"', () => {
//       spectator.setInput({
//         item: { id: '', isPrebooked: false, product: { name: 'test-alt' }, stockInfos: [] },
//       });

//       expect(spectator.query('.package-details-list-item__product-image')).toHaveAttribute('alt', 'test-alt');
//     });
//   });

//   describe('.package-details-list-item__contributors', () => {
//     it('should display contributors', () => {
//       spectator.setInput({
//         item: {
//           id: '',
//           isPrebooked: false,
//           product: { contributors: 'test-contributors' },
//           stockInfos: [],
//         },
//       });

//       expect(spectator.query('.package-details-list-item__contributors')).toHaveText('test-contributors');
//     });
//   });

//   describe('.package-details-list-item__name', () => {
//     it('should display name', () => {
//       spectator.setInput({
//         item: { id: '', isPrebooked: false, product: { name: 'test-name' }, stockInfos: [] },
//       });

//       expect(spectator.query('.package-details-list-item__name')).toHaveText('test-name');
//     });
//   });

//   describe('.package-details-list-item__shelf-info', () => {
//     it('should display the compartment', fakeAsync(() => {
//       spectator.component.compartment$ = of('test-compartment');
//       spectator.detectComponentChanges();
//       spectator.tick();
//       expect(spectator.query('.package-details-list-item__shelf-info')).toHaveText('test-compartment');
//     }));
//   });

//   describe('.package-details-list-item__format', () => {
//     it('should set the src-attribute in the img-tag to /assets/images/Icon_${foramt}.svg', () => {
//       spectator.setInput({
//         item: { id: '', isPrebooked: false, product: { format: 'test-format' }, stockInfos: [] },
//       });

//       expect(spectator.query('.package-details-list-item__format img')).toHaveAttribute('src', '/assets/images/Icon_test-format.svg');
//     });

//     it('should set the alt-attribute in the img-tag to "test-format-detail"', () => {
//       spectator.setInput({
//         item: { id: '', isPrebooked: false, product: { formatDetail: 'test-format-detail' }, stockInfos: [] },
//       });

//       expect(spectator.query('.package-details-list-item__format img')).toHaveAttribute('alt', 'test-format-detail');
//     });

//     it('should have text "test-format-detail" in the span-tag', () => {
//       spectator.setInput({
//         item: { id: '', isPrebooked: false, product: { formatDetail: 'test-format-detail' }, stockInfos: [] },
//       });

//       expect(spectator.query('.package-details-list-item__format span')).toHaveText('test-format-detail');
//     });
//   });

//   describe('.package-details-list-item__ean', () => {
//     it('should display ean', () => {
//       spectator.setInput({
//         item: { id: '', isPrebooked: false, product: { ean: 'test-ean' }, stockInfos: [] },
//       });

//       expect(spectator.query('.package-details-list-item__ean')).toHaveText('test-ean');
//     });
//   });

//   describe('.package-details-list-item__series', () => {
//     it('should display series', () => {
//       spectator.setInput({
//         item: { id: '', isPrebooked: false, product: { volume: 'test-series' }, stockInfos: [] },
//       });

//       expect(spectator.query('.package-details-list-item__series')).toHaveExactText('Band/Serie test-series', { trim: true });
//     });
//   });

//   describe('.package-details-list-item__inventory-quantity', () => {
//     it('should display the inventory quantity', () => {
//       spectator.component.inStock$ = of(5);

//       spectator.detectComponentChanges();

//       expect(spectator.query('.package-details-list-item__inventory-quantity .isa-label')).toHaveText('5');
//     });
//   });

//   describe('.package-details-list-item__package-quantity', () => {
//     it('should display the package quantity', () => {
//       spectator.setInput({
//         item: { id: '', isPrebooked: false, product: {}, stockInfos: [], quantity: 5 },
//       });

//       expect(spectator.query('.package-details-list-item__package-quantity .isa-label')).toHaveText('5');
//     });
//   });
// });
