samedi 5 janvier 2019

Angular testing attributes

I've decided to cover my angular7 application with tests via jasmine and karma and found some sort of debt.

  • 1) if I looking for div via By.css and that div don't have any unique identifiers like class name or id. Is it the right way to create unique attributes like testName="bla-bla" and use it in jasmin.
  • 2) How should I write tests on a component which may be displayed or not be displayed depending on variables. should I write

    it('should display if true ...') and it('shouldn't' display if false) or create one test or create many tests what kind of approach should I take?

Aucun commentaire:

Enregistrer un commentaire