Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

Checking if multiple elements are rendering using jasmine

it('should check if all div are appearing which are dependent on a common condition', () => {
  component.someCommonCondition = true;
  fixture.detectChanges();
  // now the prob lies in line below since it only gets the first element of the mentioned class
  const contentChecks = fixture.debugElement.queryAll(By.css('.someClass'))
  expect(contentChecks.length).toBe(3);
})
 
PREVIOUS NEXT
Tagged: #Checking #multiple #elements #rendering #jasmine
ADD COMMENT
Topic
Name
6+2 =