Skip to content
This repository has been archived by the owner on Jun 22, 2024. It is now read-only.

Frontend Testing Added #13

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
Draft

Conversation

ValeriaLG
Copy link
Collaborator

Tests the functionality of the schedule filtering between the following endpoints:

-     http://localhost:3000/#/
-     http://localhost:3000/#/filtered
-     http://localhost:3000/#/single?place=MAGES+1
-     http://localhost:3000/#/filtered&single?place=MAGES+1

** MAGES+1 can be any panel name as long as it's concatenated with a + plus sign

After NPM installing the testing packages, you can run the tests by typing npm test or to see the test coverage, you can type npx jest --coverage --colors.

A few things to note:

  • This branch should be checked to ensure it doesn't break the build/anything on the backend before being merged in
  • App.test.js was deleted entirely due to it causing problems
  • The files/folders that should be ignored from the final build (like devdependencies is in the package.json) is:
    • __ mocks __
    • .babelrc
    • babel.config.js
    • enzyme.config.js
    • jest.config.js
    • Any files ending in .spec.js or .test.js

* Made it so that the tests check if it's in the same day before doing the test
* Added another expect clause to the single panel first test
* Added another test for unfiltered full panel display
* Added a test to clear intervals
@ValeriaLG ValeriaLG marked this pull request as draft December 30, 2021 05:12
* Adds initial test files to achieve 100 percent code coverage for Clock, Loading and Map
* Adds a few instanbul ignore comments above the loading ternary statement due to it being unreachable but adding to the untested lines count and to the top of the cleanPanelInfoTimes function since the argument defaults add to multiple branches and removing the defaults doesn't lower code coverage
* Excluded index.js, reportWebVitals.js, and setupTests.js from the code coverage report due to their irrelevance
* Added a React import at the top of App.js
* Added a test file for App.js called App.spec.js to just look and see if the component renders
* Added another unit test to advance timers in the app to see if the setInterval in Main changes what is displayed
* Added another expect clause to Correc time & panel name is displayed to include a check for the panel name
* Reset what is changed for the newly added unit test the unix times to what they originally were
* Updated the checks date unit test in the Clock.spec.js file to have it's test updated with the current day since it was failing for any hard text days
* Added jest.useRealtimers in the afterEach parts of tests so that it's properly cleaned up between tests
@ValeriaLG ValeriaLG marked this pull request as ready for review January 1, 2022 19:55
@ValeriaLG ValeriaLG changed the title WIP: Frontend Testing Added Frontend Testing Added Jan 1, 2022
@ValeriaLG ValeriaLG linked an issue Jan 1, 2022 that may be closed by this pull request
@ValeriaLG ValeriaLG marked this pull request as draft January 4, 2022 04:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Frontend Unit tests
1 participant