User Tools

Site Tools


dev:contributing:qa

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
dev:contributing:qa [2024/09/13 13:24] – [C Unit Tests] add a tag sandbergjadev:contributing:qa [2025/06/27 15:36] (current) – [Angular Unit Tests] add common things that break them sandbergja
Line 65: Line 65:
 </code> </code>
  
 +=== Common things that break Angular unit tests ===
 +
 +== Changing DOM selectors ==
 +
 +If the test is expecting a certain DOM element, but you change the structure within an Angular template, the test might start failing.
 +
 +Note that you can use text of a button as a selector.  If the button text changes, you'll need to update the selector.
 +
 +To fix it: update the selector in the test.  Or perhaps the test can be made more general.
 +
 +== Adding a new service ==
 +
 +Adding a new service
 +
 +To fix it: add a mock for the new service in the test.  Or even better, consider if you can simplify or refactor the component so that it does not need many different services.
 +
 +== Lifecycle/timing issues ==
 +
 +Interacting with anything asynchronous (especially grid and combobox) requires some care!
 +
 +To fix it: You may be able to add a setTimeout.  Or use Angular's fakeAsync and tick.
 ==== Angular e2e (end-to-end) Tests ==== ==== Angular e2e (end-to-end) Tests ====
  
dev/contributing/qa.txt · Last modified: 2025/06/27 15:36 by sandbergja

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

© 2008-2022 GPLS and others. Evergreen is open source software, freely licensed under GNU GPLv2 or later.
The Evergreen Project is a U.S. 501(c)3 non-profit organization.