uprm-inso4117-2023-2024-s2 / semester-project-study-pet

semester-project-study-pet created by GitHub Classroom
1 stars 3 forks source link

Expand BDD test coverage #330

Closed diego-velez-upr closed 2 months ago

diego-velez-upr commented 2 months ago

Overview

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.