swagger-editor icon indicating copy to clipboard operation
swagger-editor copied to clipboard

SwaggerEditor@next: re-add Jest unit tests

Open tim-lai opened this issue 3 years ago • 1 comments

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 avatar Aug 01 '22 16:08 tim-lai

@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.

char0n avatar Aug 02 '22 07:08 char0n

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

tim-lai avatar Aug 11 '22 22:08 tim-lai