Skip to content

Increase specs for Posts Lists component #49

@paul-barry-kenzan

Description

@paul-barry-kenzan

The final Post Lists spec has ~15 expect() statements. If one were to fail, the entire block would fail, but wouldn't necessarily indicate WHICH expect was failing.

If the spec is determining that the component "should test that 2 posts are rendered in the component", then the expect should verify that a count/length is "2". Any other expect statement(s) should be relocated to a new spec that describes what is being checked.

// for example
it('should display "Latest Posts" as a title', function () {
  // spec setup if necessary
  // ...
  expect(componentTitle[0].textContent).toBe('Latest Posts');
});

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions