cypress-example-conduit-app icon indicating copy to clipboard operation
cypress-example-conduit-app copied to clipboard

Show how to test duplicate article title support

Open bahmutov opened this issue 6 years ago • 0 comments

In file /server/lib/models/article.js we have a missed branch that creates a slug for an article - if there is an article with the same title, then the API adds a random 6 string suffix.

Screen Shot 2019-08-06 at 3 58 17 PM

it would be very nice to show how to test this using the code coverage as a guide

  • API test seems the simplest, yet does not verify that the user interface handles the returned slug. Maybe it goes to the original article slug even when it should go to the second article?!
  • E2E test seems ideal
    • create both articles via UI
    • confirm first slug
    • confirm the second slug
    • create first article via API call, then create the second article via UI

bahmutov avatar Aug 06 '19 20:08 bahmutov