This PR closes issue #268 by adding BDD tests for the Shop page.
Tests
A new Cucumber Shop.feature test was added under features with their corresponding step definitions in the features/step_definitions/stepdefs.js. The tests should cover the filtering, buying and money resetting features within the Shop page.
Running
To run the tests, you need to have Firefox installed, the expo server running in the background (npx expo start), and run the tests by executing npm run test-cucumber.
Dependency Issue
Prior to this PR, tests were failing due to unknown errors. After investigating, I discovered that the dependencies were the culprits, and that this happened because of PR #311.
Dependency @testing-library/jest-native has a dependency itself on react-test-renderer, and that dependency depends on a version of react that our project is not using, thus causing an error whenever updating dependencies.
The solution was to downgrade @testing-library/jest-native to a version where the version of react-test-renderer uses a version of react that we can use as well.
Testing Issue
Prior to this PR, tests were outright broken in PR #312 by changing the browser they used to Chrome, when they were originally written using Firefox. Implementation with Chrome proved to be unnecessarily complex, so I decided to switch back to Firefox.
Overview
This PR closes issue #268 by adding BDD tests for the Shop page.
Tests
A new Cucumber
Shop.feature
test was added underfeatures
with their corresponding step definitions in thefeatures/step_definitions/stepdefs.js
. The tests should cover the filtering, buying and money resetting features within the Shop page.Running
To run the tests, you need to have Firefox installed, the expo server running in the background (
npx expo start
), and run the tests by executingnpm run test-cucumber
.Dependency Issue
Prior to this PR, tests were failing due to unknown errors. After investigating, I discovered that the dependencies were the culprits, and that this happened because of PR #311.
Dependency
@testing-library/jest-native
has a dependency itself onreact-test-renderer
, and that dependency depends on a version ofreact
that our project is not using, thus causing an error whenever updating dependencies.The solution was to downgrade
@testing-library/jest-native
to a version where the version ofreact-test-renderer
uses a version ofreact
that we can use as well.Testing Issue
Prior to this PR, tests were outright broken in PR #312 by changing the browser they used to Chrome, when they were originally written using Firefox. Implementation with Chrome proved to be unnecessarily complex, so I decided to switch back to Firefox.