Angular UnitTesting Multiple CSS Value

it('Displays First Day of Week correctly', () => {

    fixture.detectChanges();

    let debugElement: DebugElement[] = fixture.debugElement.queryAll(By.css('.date'));
   
    let weekDays = ['15 Mon','16 Tue','17 Wed','18 Thu','19 Fri'];
    let i = 0;
    debugElement.forEach(x => {
      expect(x.nativeElement.textContent).toBe(weekDays[i]);
      i++;
    });

  });
It's only fair to share...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Leave a Reply

Your email address will not be published. Required fields are marked *