VAOS Page: TypeOfVisitPage - should not submit empty form
VAOS Page: ClosestCityStatePage - should not submit without choosing a site
Issues or enhancements involving test infrastructure and libraries
Currently alerts from validation is difficult to write assertions for in certain unit tests since the DOM does not update after user action (e.g. clicking a button or choosing an option) is made. Ideally we should be able to assert alerts are displayed correctly to ensure the desired component behaviors.
Steps to Reproduce
Enable the disabled assertions in the test that link to this issue and the test will fail
Actual Result
Currently these assertions are disabled so no errors are observed but enabling the assertions will result in the following stack traces:
Expand stack trace
```
1) VAOS Page: ClosestCityStatePage
should not submit without choosing a site:
Unable to find role="alert"
Error: Unable to find role="alert"
at waitForWrapper (node_modules/@testing-library/dom/dist/wait-for.js:173:27)
at findByRole (node_modules/@testing-library/dom/dist/query-helpers.js:101:33)
at _callee2$ (src/applications/vaos/tests/new-appointment/components/ClosestCityStatePage.unit.spec.js:75:25)
at tryCatch (node_modules/regenerator-runtime/runtime.js:63:40)
at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:294:22)
at Generator.next (node_modules/regenerator-runtime/runtime.js:119:21)
at asyncGeneratorStep (src/applications/vaos/tests/new-appointment/components/ClosestCityStatePage.unit.spec.js:19:103)
at _next (src/applications/vaos/tests/new-appointment/components/ClosestCityStatePage.unit.spec.js:21:194)
```
Summary
Currently alerts from validation is difficult to write assertions for in certain unit tests since the DOM does not update after user action (e.g. clicking a button or choosing an option) is made. Ideally we should be able to assert alerts are displayed correctly to ensure the desired component behaviors.
Steps to Reproduce
Actual Result
Currently these assertions are disabled so no errors are observed but enabling the assertions will result in the following stack traces:
Expand stack trace
``` 1) VAOS Page: ClosestCityStatePage should not submit without choosing a site: Unable to find role="alert"Definition of Done