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

Updated the pinia store in src/stores/gameList.js so that it works with the list of players in the game. #5

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

zanzoonh
Copy link

@zanzoonh zanzoonh 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

This pull request aims to resolve issue #8

This pull request works on editing the frontend so that the functions used are now implementing and editing the array rather than the length of the array, and the frontend can actually show the new updated feature

File changed: src/stores/gameList.js

Updated the GameSummary constructor to use the players array itself instead of creating a numPlayers attribute using the length of the players list.
Updated the joinGame() and otherLeftGame() attributes to .push() and .pop() players from the relevant game’s .players() array rather than incrementing/decrementing the player count.

Unit tests were created and executed to validate
The unit tests ensure consistent behavior and compatibility with the backend requirements.

@zanzoonh zanzoonh self-assigned this Dec 12, 2024
@Hakaabi Hakaabi added the enhancement New feature or request label Dec 12, 2024
@Hakaabi Hakaabi added this to the Sprint 5 - Coretask milestone Dec 12, 2024
@Hakaabi Hakaabi self-requested a review December 12, 2024 20:58
Copy link

@Hakaabi Hakaabi left a comment

Choose a reason for hiding this comment

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

Great work implementing this, looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor GameSummary Constructor and Update joinGame/otherLeftGame Methods
2 participants