Closed astorije closed 6 years ago
At the moment, one has to write:
expect(component).toHaveHTML('<div class="row"><div class="col-1"><div class="tile"><div class="label">Label line</div><div class="content">Value line</div><div class="footnote">Footnote line</div></div></div></div>');
It would be really nice if this could be expanded in a more readable form and let the assertion ignore the blanks between tags:
expect(component).toHaveHTML( `<div class="row"> <div class="col-1"> <div class="tile"> <div class="label">Label line</div> <div class="content">Value line</div> <div class="footnote">Footnote line</div> </div> </div> </div>` );
I have this change locally and it works well, haven't noticed any downsides so far, so happy to turn it into a PR if you are open to that.
(I cannot use something like:
expect(component).toHaveHTML( '<div class="row">' + '<div class="col-1">' + /* ... */
because automated formatters such as Prettier reformat this accordingly.)
I think this would be a great addition! Would love to see the PR
Awesome, thanks @blainekasten, I did this in #250!
At the moment, one has to write:
It would be really nice if this could be expanded in a more readable form and let the assertion ignore the blanks between tags:
I have this change locally and it works well, haven't noticed any downsides so far, so happy to turn it into a PR if you are open to that.
(I cannot use something like:
because automated formatters such as Prettier reformat this accordingly.)