import { HttpClientModule } from '@angular/common/http';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatDialogModule } from '@angular/material/dialog';
import { MatTableModule } from '@angular/material/table';
import { MatToolbarModule } from '@angular/material/toolbar';
import { MatTooltipModule } from '@angular/material/tooltip';
import { TeamsService } from '../teams.service';

import { OverviewComponent } from './overview.component';

describe('OverviewComponent', () => {
  let component: OverviewComponent;
  let fixture: ComponentFixture<OverviewComponent>;
  const mockTeamsService = jasmine.createSpyObj('TeamsService', ['']);
  mockTeamsService.team = { players: []}

  beforeEach(async () => {
    await TestBed.configureTestingModule({
      declarations: [ OverviewComponent ],
      imports: [ HttpClientModule, MatDialogModule, MatToolbarModule, MatTableModule, MatTooltipModule ],
      providers: [
        { provide: TeamsService, useValue: mockTeamsService }
      ]
    })
    .compileComponents();

    fixture = TestBed.createComponent(OverviewComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

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

  it('should initialise the datasource', () => {
    expect(component.dataSource).not.toBeNull();
  })
});
// this.teamsService.team.players