import { TestBed, ComponentFixture } from '@angular/core/testing';
import { ShelfHistoryLogHeaderComponent } from './log-header.component';
import { DebugElement, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { By } from '@angular/platform-browser';

fdescribe('ShelfHistoryLogHeaderComponent', () => {
  let fixture: ComponentFixture<ShelfHistoryLogHeaderComponent>;
  let component: ShelfHistoryLogHeaderComponent;
  let debugElement: DebugElement;

  beforeEach(async () => {
    TestBed.configureTestingModule({
      declarations: [ShelfHistoryLogHeaderComponent],
      schemas: [CUSTOM_ELEMENTS_SCHEMA],
    }).compileComponents();
  });

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

    component.infoText = 'Mock Info Text';
    component.statusText = 'Mock Status Text';

    fixture.detectChanges();
  });

  it('should be created', () => {
    expect(component instanceof ShelfHistoryLogHeaderComponent).toBeTruthy();
  });

  it('should show info text', () => {
    const infoTextElement: HTMLHeadingElement = debugElement.query(By.css('.info-text')).nativeElement;

    expect(infoTextElement.textContent).toBe(component.infoText);
  });

  it('should show status text', () => {
    const statusTextElement: HTMLHeadingElement = debugElement.query(By.css('.status-text')).nativeElement;

    expect(statusTextElement.textContent).toBe(component.statusText);
  });
});
