Skip to content
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
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

galishaq
Copy link

@galishaq galishaq commented Dec 10, 2024

Issue number

Relevant issue number

Please check the following

  • Do the tests still pass? (see Run the Tests)
  • Is the code formatted properly? (see Linting (Formatting))
  • For New Features:
    • Have tests been added to cover any new features or fixes?
    • Has the documentation been updated accordingly?

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

Ghalya AL-Eshaq added 17 commits December 8, 2024 15:21
…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
…in a game in file test/e2e/spec/out-of-game/hoe.spec.js
…ll try to test simutanously between backend and frontend in home.spec.js
@galishaq galishaq self-assigned this Dec 10, 2024
@galishaq galishaq changed the title Fix find spectatable games backend Update findSpectatableGames Helper to Include Players' Usernames Dec 10, 2024
@galishaq galishaq linked an issue Dec 10, 2024 that may be closed by this pull request
@Hakaabi Hakaabi added this to the Sprint 5 - Coretask milestone Dec 12, 2024
@Hakaabi Hakaabi added the enhancement New feature or request label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update findSpectatableGames to include player details in the response.
2 participants