Skip to content

Frontend tests#212

Merged
eplxy merged 5 commits intophase-4from
frontend-tests
Nov 26, 2025
Merged

Frontend tests#212
eplxy merged 5 commits intophase-4from
frontend-tests

Conversation

@eplxy
Copy link
Copy Markdown
Owner

@eplxy eplxy commented Nov 26, 2025

DECLARATION OF COPILOT USAGE

All tests were generated by Copilot (Claude Sonnet 4.5), but I made tweaks to them where needed (some would not run).

Description

  • Using Vitest, v8, and React Testing Library, add a few frontend unit tests.
  • Also add a github actions workflow for frontend CI.

Coverage

Code coverage metrics were set up using v8 as a provider.
vitest-ui was added as a dev dependency to visualize the tests as well.

image

@eplxy eplxy added this to the Phase 4 milestone Nov 26, 2025
@eplxy eplxy self-assigned this Nov 26, 2025
@eplxy eplxy added frontend This is related to frontend development phase 4 Issues related to phase 4 unit test Writing tests or refactoring to improve testability labels Nov 26, 2025
@eplxy eplxy linked an issue Nov 26, 2025 that may be closed by this pull request
@eplxy eplxy enabled auto-merge (squash) November 26, 2025 04:59
@catalexandre catalexandre self-requested a review November 26, 2025 05:08
Copy link
Copy Markdown
Collaborator

@catalexandre catalexandre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@eplxy eplxy merged commit 83af833 into phase-4 Nov 26, 2025
1 check passed
eplxy added a commit that referenced this pull request Nov 26, 2025
* Fixed typo in 'Members' section header (#134)

* Refactor DB Manager to Implement an Interface (#136)

* made DB manager implement interface, made services depend on the interface, and minor cleanup

* removed unused authentication classes/code

* added endpoint and service to change rider plan type (#138)

* Fix docking stations under maintenance not showing occupied docks (#151)

* Cleanup console logs

* Change logic for DockDTO creation isOccupied (since OCCUPIED dock state competes with MAINTENANCE)

* Show docking station state on marker

* Make Operators Riders Through Inheritance (#148)

* Reservation payment plan flow (#153)

* Start UI

* Rename exported component

* Add new endpoint and finish flow

* Display pricing on first step if the user has a monthly membership

* Change next button text if the user has a monthly subscription

* Fix misnamed body parameter

* Fix various frontend bugs (#155)

* Sort bills by latest to oldest

* Fix reserve bike button being enabled when the user can't reserve

* Fix marker shadow looking off when a station is out of service or under maintenance

* Refetch map on station action (#156)

* Update the markers if a station action was taken (e.g. undock, dock, change state, reserve)

* Fix crash on map load, change the marker for the 100th time (only on non-operational)

* Added loyalty tier to rider (#149)

* Added flex credit reward on end trip (#150)

* Added flex credit reward on end trip

* Updated comments

* Update backend/src/main/java/org/crossroads/Domain/BikeSharingServices/TripServices.java

Co-authored-by: William Ross <william.ross.lpp.83@gmail.com>

---------

Co-authored-by: William Ross <william.ross.lpp.83@gmail.com>

* Invalidate the getRiderPlan query when a plan is changed (#163)

* Modified Domain Model (#169)

* made Operator a child of Rider

* added loyalty tier and flex dollars to Rider class

* Operator flow - Change bike/dock state (#165)

* Start working on mark for maintenance

* Continue mark for maintenance styling and list display

* Add query

* Added a route to retrieve a user's flex dollars (#171)

* Added a route to retrieve a user's flex dollars

* Added flex dollars to userinfo route

* Fixed the null authenticationManager (#177)

* Fixed the deletion of tickets to revert the changes to bikes and docks (#179)

* 172 bug executing tickets seems to do nothing (#178)

* Fixed the null authenticationManager

* Made the execution of tickets function as expected

* Loyalty, About Us, How It Works Pages + Pricing Button (#159)

* Loyalty Done

* AboutUs and HowItWorks Pages Completed

* Added button to Pricing

* Updated the About Us Page

* Can change plan to monthly in pricing page

* Selected Background when Monthly is selected

* Fixed an issue + added cancel subscription button

* Fixed the reload page issue

---------

Co-authored-by: Arturo <DaKingzz@users.noreply.github.com>

* Cool update to show "issued_at" and bikeIds in return value of tickets. (#180)

* Set Up Decorator Design Pattern for Discounted Cost Calculation (#147)

* added concrete discount decorators for flex dollars, operators and layalty programs

* added decoration configuration

* fixed minor issues and added extra decorator

* changed how the discount is caluclated

* Minor PR (#185)

* added concrete discount decorators for flex dollars, operators and layalty programs

* added decoration configuration

* fixed minor issues and added extra decorator

* changed how the discount is caluclated

* minor fix

* fixed formating

* Modified End Trip Return Object (#182)

* changed end trip return object, fixed unit tests to work with that change

* minor fix to reflect f$ utilization

* Operator flow - Move bikes (#175)

* Start working on mark for maintenance

* Continue mark for maintenance styling and list display

* Add query

* Start adding move bikes operation

* Add ticket creation queries

* Finish move bike dialog

* silly goofy statement in loop!

* Add ticket UI

* yeah i don't need ts

* Run filter before findFirst

* Add tooltip to refresh, and add transfer state

* Adjust default expanded state

* Link execute and cancel operations, add detailed info.

* Remove unused state

* Fix frontend crash on end trip (#189)

* Fix crash on endTrip

* Display new flex credit balance on trip end

* Self-review

* Added leaderboard routes (#190)

* Added leaderboard routes

* Made leaderboard routes unprotected

* Added a function that changes bike and dock States in bulk (#183)

* Added a function that changes bike and dock States in bulk

* fixed mapping

* fixed comments

* fixed comments

* Dual roles (#193)

* Add role to store and local storage

* Change toggle button, and flag based on role

* Self-review

* Phase 4 Demo Seed (#191)

* started the phase 4 demo data loading implementation

* minor clean up and complete user creation in seed file, starting working on trips and reservations

* minor cost details str fix

* added the necessary trips and reservations to have a rider/operator of each tier

* made op 2 bronze, but meet the silver requirements

* ensured riders surpassed needed number of trips and gave a rider a timed out reservation

* made big bird BRONZE

---------

Co-authored-by: Mach2-1 <103284465+Mach2-1@users.noreply.github.com>

* Left panel placeholders (#197)

* Added trip id parameter to trip search (#196)

* 188 leaderboard (#201)

* Leaderboard Page Implementation + Gotta Fix the no rides yet issue to fully test the UI

* Merge Test

* Leaderboard Page Merge Test

* Merge Query

---------

Co-authored-by: Arturo <DaKingzz@users.noreply.github.com>

* added tier verification (#187)

* added tier verification

* Tested all tier eligibility and fixed the gold tier check

* fixed method names

* made decorators use discount rate from enum (#205)

* Modified Leaderboard Logic (#204)

* Added bill creation for monthly plan (#206)

* Account info (#207)

* Added account info page

* Added real values instead of placeholders, loyalty tier badge remains to be added

* Added correct loyalty tier badge on account info page

Had to mess with the backend slightly so I could grab the loyalty tier value but it should be good.

* Add toggle switch button

* Only render button if the user is an operator

---------

Co-authored-by: Steven <93779447+eplxy@users.noreply.github.com>

* Fix undefined cost on search by trip Id (#202)

* Implemented overflow credits (#200)

* Fixed reservation bugs (#208)

* fixed reservation bugs

* uncommented annotation

* Fix searchTrips not properly checking if the user is an operator (#209)

* Display monthly bills in billing page (#210)

* Add popup for loyalty tier changes (#211)

* Add popup for loyalty tier changes

* Fix typo

* Frontend tests (#212)

* Add a couple of frontend tests

* CI-1

* Add phase-4 to the path

* fuck it

* change name

* 141 implement automated testing unit system integration (#192)

* Wrote bill entity tests

* Wrote all entity tests and modified ID generation strategy to AUTO to function properly with H2 engine.

* Wrote ticket services tests

* Modified trip services to not load the entire application context.

Implement jacoco plugin for easy reading of test coverage.

Implement different ticket tests for execute and delete ticket service methods

* Wrote tests for all controllers and covered extra service execution paths

* Formatting changes

* fixed imports

---------

Co-authored-by: Will <william.ross.lpp.83@gmail.com>

---------

Co-authored-by: Arturo <123595364+DaKingzz@users.noreply.github.com>
Co-authored-by: William Ross <william.ross.lpp.83@gmail.com>
Co-authored-by: Alexandre Catellier <146765656+catalexandre@users.noreply.github.com>
Co-authored-by: Arturo <DaKingzz@users.noreply.github.com>
Co-authored-by: Mach2-1 <103284465+Mach2-1@users.noreply.github.com>
Co-authored-by: thekillerturkey <70587573+thekillerturkey@users.noreply.github.com>
@eplxy eplxy deleted the frontend-tests branch November 26, 2025 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend This is related to frontend development phase 4 Issues related to phase 4 unit test Writing tests or refactoring to improve testability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement automated testing (unit + system/integration)

2 participants