Test Case Problems

Hi there, hope you have a nice day. For the past week, I have been working on doing some changes for my test case. Focusing on do a little changes and add some new methods to make the test case passed without errors.

Firstly, for my first test case which is test on scanning of correct code should navigate back to the list view. For example, when the user enter the correct code it will automatically navigate back to the list view. Apart from that, Peter help me to mock the test suite globally. There are times where we need to mock functions like fetch for example, etc., globally instead of mocking individually in each file. Node Package Manager (NPM) modules like jest-fetch-mock, etc., are there for rescue to mock these globally. With this approach, we can mock any API globally that we need to.

Next, for my second test case which is test on scanning of incorrect code should prompt error box and navigate back. For example, when the user enter the incorrect code, the prompt error box will pop-up and show invalid. At first for this test case, I get an error on test id. The error cause from my silly mistake which is I get the test id from another file which is the incorrect one. After that, Peter showed me the correct file which is I should take the test id. I am grateful and thanks to Peter for helping me to solve the problems.

Overall I am thankful to Peter and also to learn more about writing a test case. I am keen to keep improving and learning new things, even though it can be difficult for me at times.

Leave a Reply