DEV Community

Cover image for Devlog #01
Martin Emmert
Martin Emmert

Posted on • Edited on

Devlog #01

27.08.2020

After bootstrapping my new application with my personal example NextJs application, I prepared the phrasing of test cases that should be passed to match the acceptance criteria of the first user story.

As a user, I want to write down my thoughts in a bullet list so that I can see them all in one place. #2

Acceptance criteria:

  • [ ] the document is initially empty
  • [ ] each bullet point has a unique id
  • [ ] pressing enter exits the editing of the current bullet point, creates a new one below and enters its editing mode
  • [ ] pressing escape discards the current changes, if nothing was written, the bullet point is removed

Screenshot of empty test descriptions


After that, I added some actual tests and wrote the code needed to pass them.

Screenshot of test cases that describe what my program should do if a button with the text Add is clicked

Screenshot of code that passes the updated test cases

Screenshot of Terminal with green tests

๐Ÿ‘


Finally, I updated the first test case with my expectations of what should happen if the 'Add' button is clicked twice.

Screenshot of test cases that describe what my program should do if a button with the text Add is clicked twice

I really like writing tests with the @testing-library. It gives the reader a clear picture of what to expect without going into the implementation details.

The implementation will be part of the next update.


Cover Photo by Volodymyr Hryshchenko on Unsplash

Top comments (0)