SwaggerEditor@next: re-add Jest unit tests
Q&A (please complete the following information)
- Swagger-Editor version: alpha.12
Describe the bug you're encountering
Jest unit tests got removed in in https://github.com/swagger-api/swagger-editor/pull/3241. They should be re-implemented.
To reproduce...
Expected behavior
Screenshots
Additional context or thoughts
At the time of creation, the Jest/TestingLibrary tests were focused on React screen elements. May want to revisit unit test strategy to cover more core functions.
fyi @char0n
@tim-lai I would reconsider. It's very complicated to maintain tests written in that fashion and their real value is questionable to me. Couldn't these tests be replaced by simple BDD e2e tests using cypress? The reason why I removed them was that these tests are bound with implementations details. If underlying implementation is changed they need to be rewritten. If we used e2e tests, nothing would need to be rewritten.
Migration from Jest to Cypress in the following PRs: #3350 #3356 #3357 #3361 #3362 #3363 #3368 #3369 #3374 #3375 #3377
These PRs collectively increases overall test coverage compared to the original set of Jest tests, including previously "Not Yet Implemented" tests. Given that the intent of the original Jest tests was to be more durable against internal changes, and focused on UI interactions, I think that these Cypress tests will hopefully do a better job absorbing future internal changes.
cc: @char0n