forked from cuttle-cards/cuttle
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update findSpectatableGames Helper to Include Players' Usernames #17
Open
galishaq
wants to merge
17
commits into
main
Choose a base branch
from
fix-findSpectatableGames-backend
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…iated with a game by populating players data in the query in file api/helpers/find-spectatable-games.js
…include only players id and username in file api/helpers/find-spectatable-games.js
…edGames variable so that the function returne playes' only id and username in file api/helpers/find-spectatable-games.js
…est/e2e/spec/out-of-game/hoe.spec.js
…in a game in file test/e2e/spec/out-of-game/hoe.spec.js
… file test/e2e/spec/out-of-game.js
…ll try to test simutanously between backend and frontend in home.spec.js
galishaq
changed the title
Fix find spectatable games backend
Update findSpectatableGames Helper to Include Players' Usernames
Dec 10, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue number
Relevant issue number
Please check the following
Please describe additional details for testing this change
Changes Made:
Updated the findSpectatableGames helper under the path api/helpers/find-spectatable-games.js:
Added functionality to populate players in the query to ensure that each game includes player details.
The players' data is transformed so that only the id and username fields are returned, removing the count.
Testing:
Created a new file game-list.spec.js under the path tests/unit/specs/sails/ to unit tests the helper findSpectatbleGames(), specifically created the file to test backend changes in the file api/helpers/find-spectatable-games.js. But then deleted this file because cuttle focuses on testing end to end in cypress, meaning it’s the code is tested through the front and backends simultaneously
Added some test cases in test/e2e/out-of-game/home.spec.js to ensure that in the home page player counts is now shown as players username