-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat(game-lobby): game options confirm step in lobby #845
Conversation
WalkthroughThis pull request introduces significant enhancements to the game lobby interface, particularly focusing on the "Game Lobby Confirm Dialog" and associated components. It adds new event handlers, modifies existing functionalities, and introduces a comprehensive testing framework to ensure robust interaction management. Additionally, it improves localization and user feedback mechanisms, particularly regarding game options changes, enhancing the overall user experience in the game lobby. Changes
Possibly related PRs
Suggested labels
Poem
Tip Announcements
Recent review detailsConfiguration used: .coderabbit.yaml Files ignored due to path filters (10)
Files selected for processing (1)
Additional comments not posted (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (2)
app/components/pages/game-lobby/GameLobbyOptionsHub/GameLobbyOptionsHubTabView/GameLobbyOptionsHubTabView.vue (2)
9-9
: Minor refactor suggestionConsider extracting the common styles from the
PrimeVueTabList
component into a separate class to improve maintainability and reusability.-class="!pr-5" +class="game-lobby-options-hub-tab-list !pr-5"Then, define the
game-lobby-options-hub-tab-list
class in the component's style section or in a global stylesheet.
14-14
: LGTM, but consider a minor refactorThe changes to the
PrimeVueTab
components' class attributes are good. They ensure that each tab occupies one-third of the available width, improving the layout consistency.However, consider extracting the common styles into a separate class to improve maintainability and reusability.
-class="flex gap-2 items-center justify-center w-1/3" +class="game-lobby-options-hub-tab flex gap-2 items-center justify-center w-1/3"Then, define the
game-lobby-options-hub-tab
class in the component's style section or in a global stylesheet.Also applies to: 29-29, 47-47
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files ignored due to path filters (6)
public/svg/misc/rabbit-in-hat.svg
is excluded by!**/*.svg
tests/unit/specs/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/GameLobbyStartGameConfirmDialogContent/GameLobbyStartGameConfirmDialogGameOptionsChanged/ChangedGameOptionsList/__snapshots__/ChangedGameOptionsList.nuxt.spec.ts.snap
is excluded by!**/*.snap
tests/unit/specs/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/GameLobbyStartGameConfirmDialogContent/GameLobbyStartGameConfirmDialogGameOptionsChanged/__snapshots__/GameLobbyStartGameConfirmDialogGameOptionsChanged.nuxt.spec.ts.snap
is excluded by!**/*.snap
tests/unit/specs/components/pages/game-lobby/GameLobbyHeader/GameLobbyHeaderSetupButtons/GameLobbyHeaderOptionsButton/__snapshots__/GameLobbyHeaderOptionsButton.nuxt.spec.ts.snap
is excluded by!**/*.snap
tests/unit/specs/components/pages/game-lobby/GameLobbyHeader/GameLobbyHeaderSetupButtons/__snapshots__/GameLobbyHeaderSetupButtons.nuxt.spec.ts.snap
is excluded by!**/*.snap
tests/unit/specs/components/pages/game-lobby/GameLobbyOptionsHub/GameLobbyOptionsHubTabView/__snapshots__/GameLobbyOptionsHubTabView.nuxt.spec.ts.snap
is excluded by!**/*.snap
Files selected for processing (48)
- .run/Game Lobby Confirm Dialog.run.xml (1 hunks)
- app/components/pages/game-lobby/GameLobbyFooter/GameLobbyFooter.vue (2 hunks)
- app/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameButton.vue (2 hunks)
- app/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialog.vue (5 hunks)
- app/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/GameLobbyStartGameConfirmDialogContainer.vue (2 hunks)
- app/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/GameLobbyStartGameConfirmDialogContent/GameLobbyStartGameConfirmDialogContent.vue (4 hunks)
- app/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/GameLobbyStartGameConfirmDialogContent/GameLobbyStartGameConfirmDialogGameOptionsChanged/ChangedGameOptionsList/ChangedGameOptionsList.vue (1 hunks)
- app/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/GameLobbyStartGameConfirmDialogContent/GameLobbyStartGameConfirmDialogGameOptionsChanged/GameLobbyStartGameConfirmDialogGameOptionsChanged.vue (1 hunks)
- app/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/GameLobbyStartGameConfirmDialogContent/GameLobbyStartGameConfirmDialogGameOptionsChanged/game-lobby-start-game-confirm-dialog-game-options-changed.types.ts (1 hunks)
- app/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/GameLobbyStartGameConfirmDialogContent/game-lobby-start-game-confirm-dialog-content.types.ts (2 hunks)
- app/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/game-lobby-start-game-confirm-dialog-container.types.ts (1 hunks)
- app/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/game-lobby-start-game-confirm-dialog.constants.ts (1 hunks)
- app/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/game-lobby-start-game-confirm-dialog.types.ts (1 hunks)
- app/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/game-lobby-start-game-button.types.ts (1 hunks)
- app/components/pages/game-lobby/GameLobbyFooter/game-lobby-footer.types.ts (1 hunks)
- app/components/pages/game-lobby/GameLobbyHeader/GameLobbyHeader.vue (2 hunks)
- app/components/pages/game-lobby/GameLobbyHeader/GameLobbyHeaderSetupButtons/GameLobbyHeaderOptionsButton/GameLobbyHeaderOptionsButton.vue (1 hunks)
- app/components/pages/game-lobby/GameLobbyHeader/GameLobbyHeaderSetupButtons/GameLobbyHeaderSetupButtons.vue (5 hunks)
- app/components/pages/game-lobby/GameLobbyHeader/GameLobbyHeaderSetupButtons/game-lobby-header-setup-buttons.types.ts (1 hunks)
- app/components/pages/game-lobby/GameLobbyHeader/game-lobby-header.types.ts (1 hunks)
- app/components/pages/game-lobby/GameLobbyOptionsHub/GameLobbyOptionsHub.vue (1 hunks)
- app/components/pages/game-lobby/GameLobbyOptionsHub/GameLobbyOptionsHubTabView/GameLobbyOptionsHubTabView.vue (4 hunks)
- app/composables/api/game/game-options/useGameOptionsTexts.ts (2 hunks)
- app/pages/game-lobby.vue (2 hunks)
- app/plugins/vue-font-awesome-icon/vue-font-awesome-icon.ts (2 hunks)
- app/stores/game/create-game-dto/useCreateGameDtoStore.ts (4 hunks)
- modules/i18n/locales/en.json (4 hunks)
- modules/i18n/locales/fr.json (3 hunks)
- tests/acceptance/features/game-lobby/features/game-lobby-confirm-dialog/game-lobby-confirm-dialog.feature (1 hunks)
- tests/acceptance/features/game-lobby/features/game-lobby-options-hub/game-lobby-options-hub.feature (1 hunks)
- tests/acceptance/features/game-lobby/features/game-lobby.feature (1 hunks)
- tests/acceptance/features/game-lobby/step-definitions/game-lobby-options-hub/game-lobby-options-hub.then-steps.ts (1 hunks)
- tests/acceptance/features/game-lobby/step-definitions/game-lobby-options-hub/game-lobby-options-hub.when-steps.ts (1 hunks)
- tests/acceptance/features/playwright/step-definitions/texts/playwright-texts.then-steps.ts (1 hunks)
- tests/acceptance/features/support/hooks.ts (1 hunks)
- tests/unit/specs/components/pages/game-lobby/GameLobbyFooter/GameLobbyFooter.nuxt.spec.ts (1 hunks)
- tests/unit/specs/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameButton.nuxt.spec.ts (1 hunks)
- tests/unit/specs/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialog.nuxt.spec.ts (8 hunks)
- tests/unit/specs/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/GameLobbyStartGameConfirmDialogContainer.nuxt.spec.ts (1 hunks)
- tests/unit/specs/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/GameLobbyStartGameConfirmDialogContent/GameLobbyStartGameConfirmDialogContent.nuxt.spec.ts (3 hunks)
- tests/unit/specs/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/GameLobbyStartGameConfirmDialogContent/GameLobbyStartGameConfirmDialogGameOptionsChanged/ChangedGameOptionsList/ChangedGameOptionsList.nuxt.spec.ts (1 hunks)
- tests/unit/specs/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/GameLobbyStartGameConfirmDialogContent/GameLobbyStartGameConfirmDialogGameOptionsChanged/GameLobbyStartGameConfirmDialogGameOptionsChanged.nuxt.spec.ts (1 hunks)
- tests/unit/specs/components/pages/game-lobby/GameLobbyHeader/GameLobbyHeader.nuxt.spec.ts (4 hunks)
- tests/unit/specs/components/pages/game-lobby/GameLobbyHeader/GameLobbyHeaderSetupButtons/GameLobbyHeaderOptionsButton/GameLobbyHeaderOptionsButton.nuxt.spec.ts (2 hunks)
- tests/unit/specs/components/pages/game-lobby/GameLobbyHeader/GameLobbyHeaderSetupButtons/GameLobbyHeaderSetupButtons.nuxt.spec.ts (1 hunks)
- tests/unit/specs/composables/api/game/game-options/useGameOptionsTexts.spec.ts (1 hunks)
- tests/unit/specs/pages/game-lobby/game-lobby.nuxt.spec.ts (3 hunks)
- tests/unit/specs/stores/game/create-game-dto/useCreateGameDtoStore.spec.ts (1 hunks)
Files skipped from review due to trivial changes (4)
- app/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/GameLobbyStartGameConfirmDialogContent/GameLobbyStartGameConfirmDialogGameOptionsChanged/game-lobby-start-game-confirm-dialog-game-options-changed.types.ts
- app/components/pages/game-lobby/GameLobbyOptionsHub/GameLobbyOptionsHub.vue
- app/plugins/vue-font-awesome-icon/vue-font-awesome-icon.ts
- tests/acceptance/features/game-lobby/features/game-lobby.feature
Additional comments not posted (68)
app/components/pages/game-lobby/GameLobbyFooter/game-lobby-footer.types.ts (1)
5-5
: LGTM!The addition of the new event type
rejectGameOptionsChangedStep
toGameLobbyFooterEmits
is a valid change. It enhances the event handling capabilities of the game lobby footer component.app/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/game-lobby-start-game-button.types.ts (1)
5-5
: LGTM!The addition of the new event type
rejectGameOptionsChangedStep
toGameLobbyStartGameButtonEmits
is a valid change. It enhances the event-driven architecture of the game lobby start button component.app/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/game-lobby-start-game-confirm-dialog.constants.ts (1)
6-6
: LGTM!The addition of the new value
"game-options-changed"
to the constantGAME_LOBBY_START_GAME_CONFIRM_DIALOG_STEPS
is a valid change. It enhances the functionality by allowing the application to handle scenarios where game options are altered before starting the game.app/components/pages/game-lobby/GameLobbyHeader/game-lobby-header.types.ts (1)
8-8
: LGTM!The addition of the
highlightGameOptionsButton
method to theGameLobbyHeaderExposed
type is approved.tests/acceptance/features/game-lobby/step-definitions/game-lobby-options-hub/game-lobby-options-hub.when-steps.ts (1)
1-7
: LGTM!The new Cucumber step definition for hovering over the changed game options badge in the lobby is approved.
app/components/pages/game-lobby/GameLobbyHeader/GameLobbyHeaderSetupButtons/game-lobby-header-setup-buttons.types.ts (1)
8-8
: LGTM!The addition of the
highlightGameOptionsButton
method to theGameLobbyHeaderSetupButtonsExposed
type is approved.tests/acceptance/features/game-lobby/step-definitions/game-lobby-options-hub/game-lobby-options-hub.then-steps.ts (1)
5-9
: LGTM!The test step definition is correctly implemented and serves a useful purpose by checking if the changed game options badge displays the correct count in the lobby.
.run/Game Lobby Confirm Dialog.run.xml (1)
1-12
: LGTM!The run configuration for the Game Lobby Confirm Dialog is correctly implemented and serves a useful purpose by allowing the dialog to be run in isolation with the specified cucumber tags.
app/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/GameLobbyStartGameConfirmDialogContent/game-lobby-start-game-confirm-dialog-content.types.ts (1)
12-12
: LGTM!The addition of the
rejectGameOptionsChangedStep
event to theGameLobbyStartGameConfirmDialogContentEmits
type is consistent with the AI-generated summary and serves a useful purpose by allowing the dialog to reject game options changes.app/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/game-lobby-start-game-confirm-dialog.types.ts (1)
9-9
: LGTM!The addition of the
rejectGameOptionsChangedStep
event to theGameLobbyStartGameConfirmDialogEmits
type is a good enhancement. It allows the dialog to emit an event when game options are changed, which is crucial for maintaining the game state integrity and ensuring all relevant parties are informed of any modifications.app/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/game-lobby-start-game-confirm-dialog-container.types.ts (1)
15-15
: LGTM!The addition of the
rejectGameOptionsChangedStep
event to theGameLobbyStartGameConfirmDialogContainerEmits
type, along with the callback function, is a good enhancement. It allows the dialog container to handle a scenario where game options are changed and reject those changes through the specified callback. The change integrates well with the existing event emission framework.tests/acceptance/features/playwright/step-definitions/texts/playwright-texts.then-steps.ts (1)
19-20
: LGTM!The addition of the new step
Then(/^the exact text "(?<text>.+?)" should be hidden$/u, ...)
is a good enhancement to the Playwright testing framework. It allows for assertions on the invisibility of text elements, complementing the existing step that checks for visibility. This improves the robustness of the acceptance tests by enabling checks for both visible and hidden text elements.app/components/pages/game-lobby/GameLobbyFooter/GameLobbyFooter.vue (1)
14-14
: LGTM!The new event handler
@reject-game-options-changed-step
and the corresponding functiononRejectGameOptionsChangedStep
are correctly implemented. The changes enhance the component's capabilities to manage game options changes.Also applies to: 42-45
tests/acceptance/features/support/hooks.ts (1)
29-29
: LGTM, but verify the necessity of the timeout increase.The change extends the timeout duration for the
beforeAll
hook from 90 seconds to 180 seconds. This allows more time for setup operations to complete before tests are executed.Please ensure that the timeout increase is necessary to accommodate longer initialization processes or to prevent tests from failing due to timeout issues. If the tests are consistently passing with the previous timeout value, consider reverting this change to keep the test execution time optimal.
app/components/pages/game-lobby/GameLobbyHeader/GameLobbyHeaderSetupButtons/GameLobbyHeaderOptionsButton/GameLobbyHeaderOptionsButton.vue (1)
9-24
: LGTM!The changes significantly enhance the functionality and user experience of the game options button:
- The dynamic label and badge provide immediate feedback on the user's selections.
- The tooltip enhances usability by providing contextual information about the number of changes made.
- The use of
storeToRefs
and computed properties ensures reactive updates to the UI.- The localization of the tooltip message improves accessibility for users with different language settings.
Overall, these improvements contribute to a more interactive and responsive game lobby interface.
Also applies to: 29-49
app/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/GameLobbyStartGameConfirmDialogContent/GameLobbyStartGameConfirmDialogGameOptionsChanged/ChangedGameOptionsList/ChangedGameOptionsList.vue (1)
1-55
: LGTM!The code looks good and follows Vue best practices:
- The component is properly structured with a template, script, and style section.
- The component uses the Composition API with
<script setup>
syntax.- The component imports and uses necessary dependencies such as Pinia, Font Awesome, and custom composables.
- The component correctly handles user interactions and updates the store accordingly.
- The component is properly typed with TypeScript.
The code is clean, modular, and maintainable. Great job!
tests/unit/specs/components/pages/game-lobby/GameLobbyFooter/GameLobbyFooter.nuxt.spec.ts (1)
42-47
: Great addition to the test suite!The new test case verifies that the
rejectGameOptionsChangedStep
event is emitted when the game lobby start game button emits the same event. This improves the test coverage and ensures that the component correctly handles the event.The test case follows the same structure as the existing test cases and checks for the presence and length of the emitted event.
app/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/GameLobbyStartGameConfirmDialogContainer.vue (2)
31-31
: LGTM!The changes are approved.
71-73
: LGTM!The changes are approved.
tests/acceptance/features/game-lobby/features/game-lobby-options-hub/game-lobby-options-hub.feature (1)
43-50
: LGTM!The changes are approved.
app/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/GameLobbyStartGameConfirmDialogContent/GameLobbyStartGameConfirmDialogGameOptionsChanged/GameLobbyStartGameConfirmDialogGameOptionsChanged.vue (1)
1-88
: LGTM!The changes are approved.
app/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameButton.vue (2)
30-30
: LGTM!The new event listener and its naming follow the existing convention.
98-100
: LGTM!The new method correctly handles the
reject-game-options-changed-step
event by emitting therejectGameOptionsChangedStep
event, allowing the parent component to respond. The implementation is consistent with the existing code.app/components/pages/game-lobby/GameLobbyHeader/GameLobbyHeader.vue (1)
88-93
: LGTM!The new
highlightGameOptionsButton
method is implemented correctly with the necessary null check and is properly exposed usingdefineExpose
.Also applies to: 110-110
app/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/GameLobbyStartGameConfirmDialogContent/GameLobbyStartGameConfirmDialogContent.vue (5)
12-12
: LGTM!The new event listener and its naming follow the existing convention.
21-23
: LGTM!The import statements are updated correctly to include the
Component
type and modify the paths for some imports related to the new game options confirmation step.
25-25
: LGTM!The new component
GameLobbyStartGameConfirmDialogGameOptionsChanged
is imported correctly, following the existing convention.
34-39
: LGTM!The types of
confirmStepsComponents
andcurrentConfirmStepComponent
are correctly modified to use the genericComponent
type, allowing the inclusion of the newGameLobbyStartGameConfirmDialogGameOptionsChanged
component for the game options confirmation step. The changes are consistent.Also applies to: 42-42
60-62
: LGTM!The new
onRejectGameOptionsChangedStep
method correctly handles the rejection of the game options confirmation step by emitting therejectGameOptionsChangedStep
event. The implementation is consistent with the existing rejection handling methods.app/components/pages/game-lobby/GameLobbyHeader/GameLobbyHeaderSetupButtons/GameLobbyHeaderSetupButtons.vue (4)
6-6
: LGTM!The component renaming from
GameLobbyHeaderOptionButton
toGameLobbyHeaderOptionsButton
improves the clarity of the component's purpose by indicating that it encompasses multiple options.
9-9
: LGTM!The addition of the
ref
attribute to theGameLobbyHeaderOptionsButton
component enhances the component's flexibility by allowing direct access to the component instance within the script section.
40-40
: LGTM!The import statement has been correctly updated to reflect the component's new name
GameLobbyHeaderOptionsButton
, maintaining consistency and ensuring the correct component is being imported.
54-55
: LGTM!The introduction of the
gameLobbyHeaderOptionsButton
reference and thehighlightGameOptionsButton
function enhances the component's interactivity and user feedback by providing visual cues when the button is highlighted. The function's error handling ensures that the button's state is validated before attempting to animate it.Exposing the
highlightGameOptionsButton
function throughdefineExpose
improves the component's API, allowing for greater flexibility in how the button can be interacted with externally.Also applies to: 76-81
app/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialog.vue (6)
15-15
: LGTM!The addition of the
@reject-game-options-changed-step
event to theGameLobbyStartGameConfirmDialogContainer
component allows it to handle scenarios where game options have changed and trigger appropriate actions.
29-29
: LGTM!The import of the
useGameOptionsTexts
composable is necessary to utilize its functionality for handling game options texts within the component.
39-39
: LGTM!Destructuring the
createGameOptionsDto
from thestoreToRefs(createGameDtoStore)
call allows the component to reactively track changes in the game options DTO.
41-41
: LGTM!Destructuring the
changedGameOptionsTexts
from theuseGameOptionsTexts(createGameOptionsDto)
call allows the component to track the texts of the changed game options based on thecreateGameOptionsDto
.
51-52
: LGTM!The introduction of the
areGameOptionsChanged
computed property provides a clear way to determine if any game options have been altered. By integrating this computed property into theconfirmSteps
, the component dynamically reflects the state of game options in the confirmation steps.This improves the control flow and user experience during the game setup process by ensuring that the confirmation steps accurately represent the current state of the game options.
Also applies to: 57-57
95-98
: LGTM!The
onRejectGameOptionsChangedStepFromGameLobbyStartGameConfirmDialogContainer
function handles the scenario when the game options changed step is rejected. It triggers the providedrejectCallback
and emits an event to notify the parent component about the rejection.This allows the parent component to handle the rejection of the game options changed step appropriately and take necessary actions.
tests/unit/specs/components/pages/game-lobby/GameLobbyHeader/GameLobbyHeaderSetupButtons/GameLobbyHeaderOptionsButton/GameLobbyHeaderOptionsButton.nuxt.spec.ts (2)
1-5
: LGTM!The imports of
createTestingPinia
,createFakeCreateGameDto
,createFakeCompositionGameOptions
,createFakeGameOptions
, andpTooltipDirectiveBinder
are necessary to set up the testing environment and provide utility functions for creating fake data and binding directives in the tests.These imports enhance the test suite's ability to create controlled and realistic test scenarios, improving the overall quality and reliability of the tests.
9-10
: LGTM!The imports of the
Badge
andButton
types from the PrimeVue library enable type checking and improve the development experience when working with these components in the tests.tests/unit/specs/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/GameLobbyStartGameConfirmDialogContent/GameLobbyStartGameConfirmDialogGameOptionsChanged/GameLobbyStartGameConfirmDialogGameOptionsChanged.nuxt.spec.ts (1)
1-107
: LGTM!The new test file for the
GameLobbyStartGameConfirmDialogGameOptionsChanged
component is well-structured and comprehensive. It covers various scenarios and follows best practices for unit testing Vue components.tests/unit/specs/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/GameLobbyStartGameConfirmDialogContent/GameLobbyStartGameConfirmDialogGameOptionsChanged/ChangedGameOptionsList/ChangedGameOptionsList.nuxt.spec.ts (1)
1-96
: LGTM!The new test file for the
ChangedGameOptionsList
component is well-structured and comprehensive. It covers various scenarios and follows best practices for unit testing Vue components.tests/unit/specs/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/GameLobbyStartGameConfirmDialogContainer.nuxt.spec.ts (1)
82-88
: LGTM!The new test case for handling the
rejectGameOptionsChangedStep
event enhances the test coverage and ensures that the component responds appropriately to changes in game options. This improves the robustness of the event handling logic.app/pages/game-lobby.vue (1)
134-143
: LGTM!The code changes are approved.
tests/unit/specs/composables/api/game/game-options/useGameOptionsTexts.spec.ts (1)
108-121
: LGTM!The code changes are approved.
app/stores/game/create-game-dto/useCreateGameDtoStore.ts (1)
74-78
: LGTM!The code changes are approved.
tests/unit/specs/components/pages/game-lobby/GameLobbyHeader/GameLobbyHeaderSetupButtons/GameLobbyHeaderSetupButtons.nuxt.spec.ts (2)
67-72
: LGTM!The new test case correctly checks the error handling scenario when the component reference is not defined.
74-79
: LGTM!The new test case correctly checks if the options button is highlighted when the method is called from the parent component.
tests/unit/specs/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialogContainer/GameLobbyStartGameConfirmDialogContent/GameLobbyStartGameConfirmDialogContent.nuxt.spec.ts (2)
9-9
: LGTM!The import statement for the new component is correctly added.
82-91
: LGTM!The new test cases correctly check the rendering and event emission of the
GameLobbyStartGameConfirmDialogGameOptionsChanged
component.Also applies to: 135-146
tests/acceptance/features/game-lobby/features/game-lobby-confirm-dialog/game-lobby-confirm-dialog.feature (1)
1-163
: LGTM!The new feature file is well-structured and covers various scenarios related to the game lobby confirm dialog. The scenarios test the following:
- Asking the user if everybody is ready before starting the game and allowing cancellation.
- Asking the user if everybody is positioned correctly for role position-dependent games and redirecting if not.
- Asking the user if thief additional cards are placed down before starting the game and redirecting if not.
- Asking the user if actor additional cards are placed up before starting the game and redirecting if not.
- Asking the user to confirm the changed game options before starting the game and redirecting if not.
- Allowing the user to restore official rules individually by clicking on the reset button for a changed game option.
- Allowing the user to skip all game verifications before starting the game.
The scenarios cover a comprehensive set of functionalities related to the game lobby confirm dialog.
app/composables/api/game/game-options/useGameOptionsTexts.ts (1)
15-15
: LGTM!The new
getGameOptionKeyFromText
function is a useful addition to theuseGameOptionsTexts
composable. It allows retrieving game option keys based on their text representation, which improves the usability of the API.The implementation looks correct:
- It searches through the keys of
gameOptionsTexts
to find a matching value that corresponds to the providedgameOptionText
.- If a match is found, it returns the associated key; otherwise, it returns
undefined
.No issues found. The code changes are approved.
Also applies to: 117-123
tests/unit/specs/components/pages/game-lobby/GameLobbyHeader/GameLobbyHeader.nuxt.spec.ts (1)
19-19
: LGTM!The changes enhance the test coverage for the
GameLobbyHeader
component:
- A new mock for
highlightGameOptionsButton
is added to themocks
object, allowing it to be tracked during tests.- Two new test cases are introduced:
- The first test checks that an error is thrown when the
highlightGameOptionsButton
method is called while the component is not defined, ensuring the component's robustness under error conditions.- The second test verifies that when the
highlightGameOptionsButton
method is invoked, the corresponding mock function is called exactly once, confirming the method behaves as expected when the component is properly defined.The test cases look correct and no issues are found. The code changes are approved.
Also applies to: 44-44, 165-171, 189-194
tests/unit/specs/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameConfirmDialog/GameLobbyStartGameConfirmDialog.nuxt.spec.ts (1)
14-14
: LGTM!The changes enhance the test coverage for the
GameLobbyStartGameConfirmDialog
component, specifically focusing on the handling of game options within the game creation process:
- A new callback function
onRejectGameOptionsChangedStepFromGameLobbyStartGameConfirmDialogContainer
is added to theGameLobbyStartGameConfirmDialogPrivateVariables
type, allowing for the rejection of steps related to changes in game options.- The
DEFAULT_GAME_OPTIONS
constant is imported and utilized in multiple test cases to ensure that the game options are consistently applied across different scenarios.- A new test case is introduced to specifically check the behavior when game options are altered, asserting that the confirmation steps include "game-options-changed" when the options are modified.
- New test cases are added to ensure that the reject callback for the game options step is correctly invoked and that the appropriate event is emitted when this step is rejected.
The test cases look correct and no issues are found. The code changes are approved.
Also applies to: 29-29, 50-51, 93-94, 105-106, 117-118, 124-136, 241-256
tests/unit/specs/components/pages/game-lobby/GameLobbyFooter/GameLobbyStartGameButton/GameLobbyStartGameButton.nuxt.spec.ts (1)
290-296
: LGTM!The new test case looks good. It verifies the correct event propagation from the confirm dialog and enhances the test coverage.
tests/unit/specs/pages/game-lobby/game-lobby.nuxt.spec.ts (3)
32-32
: LGTM!The addition of the
highlightGameOptionsButton
mock component to thegameLobbyHeader
mock structure looks good.
55-55
: LGTM!The initialization of the
highlightGameOptionsButton
mock with a function looks good.
291-317
: LGTM!The new "Reject Game Options Changed Step" test suite looks good. It enhances the test coverage by verifying the component's behavior when the "reject game options changed step" event is emitted. The test cases cover important scenarios, such as error handling when the header is not defined, highlighting the game options button, and opening the game options hub after a timeout. The code follows the existing structure and conventions.
tests/unit/specs/stores/game/create-game-dto/useCreateGameDtoStore.spec.ts (1)
200-210
: LGTM!The new test suite for the
resetCreateGameOptionDto
method looks good. It enhances the test coverage by verifying that a specific option in thecreateGameDto
object is reset to its default value when the method is called. The test case is well-structured, following the AAA pattern, and clearly demonstrates the expected behavior. The addition of this test suite improves the overall robustness of theuseCreateGameDtoStore
tests.modules/i18n/locales/en.json (5)
16-17
: LGTM!The addition of the "confirm" action is approved.
543-543
: LGTM!The modification to the Elder's revenge description improves clarity.
1033-1034
: LGTM!The addition of the pluralized message for changed game options is approved.
1602-1606
: LGTM!The addition of the
"GameLobbyStartGameConfirmDialogGameOptionsChanged"
object is approved. It provides useful information about changed game options in the start game confirmation dialog.
1607-1609
: LGTM!The addition of the
"ChangedGameOptionsList"
object is approved. It allows resetting individual game options to the official rule.modules/i18n/locales/fr.json (3)
1032-1034
: LGTM!The French translations for the
GameLobbyHeaderOptionsButton
component look good. The pluralization handling for the number of changed game options is implemented correctly.
1037-1037
: LGTM!The French translation for "game options" in the
GameLobbyOptionsHub
component has been updated consistently.
1602-1609
: LGTM!The new French translations in the
GameLobbyStartGameConfirmDialogGameOptionsChanged
andChangedGameOptionsList
components look great:
- The number of changed game options is conveyed clearly with proper pluralization
- The option to open the game options provides a quick way to review the changes
- The alt text for resetting a specific game option to the official rule enhances accessibility
Overall, the translations are accurate and the functionality is implemented correctly.
Quality Gate passedIssues Measures |
## [1.32.0](v1.31.0...v1.32.0) (2024-09-18) ### 🚀 Features * **audio:** audio settings in local storage ([#831](#831)) ([cd8a2cb](cd8a2cb)) * **game-lobby:** all game lobby is responsive ([#877](#877)) ([aaccf38](aaccf38)) * **game-lobby:** auto-focus on player name input ([#860](#860)) ([7897da3](7897da3)) * **game-lobby:** auto-focus on player name input even after changing page ([#873](#873)) ([3bb8401](3bb8401)) * **game-lobby:** display disclaimer for small screens ([#853](#853)) ([81029b8](81029b8)) * **game-lobby:** game options confirm step in lobby ([#845](#845)) ([20cc2ce](20cc2ce)) * **game:** all game screens are responsive ([#880](#880)) ([b54b1dc](b54b1dc)) * **game:** game over screens are responsive ([#883](#883)) ([aacb761](aacb761)) * **misc-pages:** responsive for canceled game and not found game pages ([#888](#888)) ([deeb7b2](deeb7b2)) * **nuxt:** set route announcer ([#835](#835)) ([dd1115f](dd1115f)) * **nuxt:** typecheck on hooks and ci ([#832](#832)) ([794157f](794157f)) ### 🐛 Bug Fixes * **deps:** update dependency @primevue/themes to ^4.0.6 ([#842](#842)) ([4d3e063](4d3e063)) * **deps:** update dependency @primevue/themes to ^4.0.7 ([#855](#855)) ([2b80485](2b80485)) * **deps:** update dependency primevue to ^4.0.6 ([#843](#843)) ([3a20f01](3a20f01)) * **deps:** update dependency primevue to ^4.0.7 ([#856](#856)) ([6c75a61](6c75a61)) * **game-events:** icon animation null instance handler ([#889](#889)) ([ee0a17e](ee0a17e)) * **pwa:** remove redirect fallback ([#830](#830)) ([69c2c21](69c2c21)) ### 🔩 Refactor * **primevue:** use new accordion component ([#834](#834)) ([f611995](f611995)) * **primevue:** use new tab components ([#836](#836)) ([4f9c1b9](4f9c1b9)) ### ✅ Tests * **scapegoat:** acceptance tests ([#884](#884)) ([add895e](add895e)) ### 🔁 CI * **node:** use last node version in ci ([#848](#848)) ([aa047b3](aa047b3)) ### 🧹 Chore * **deps:** update commitlint monorepo to ^19.5.0 ([#852](#852)) ([cefe4af](cefe4af)) * **deps:** update dependency @cucumber/cucumber to ^11.0.1 ([#869](#869)) ([c00d3e7](c00d3e7)) * **deps:** update dependency @cucumber/cucumber to v11 ([#817](#817)) ([dcbad46](dcbad46)) * **deps:** update dependency @faker-js/faker to ^9.0.1 ([#870](#870)) ([da15f7c](da15f7c)) * **deps:** update dependency @nuxt/test-utils to ^3.14.2 ([#846](#846)) ([f0f715a](f0f715a)) * **deps:** update dependency @nuxtjs/i18n to ^8.5.2 ([#764](#764)) ([0fe9bf0](0fe9bf0)) * **deps:** update dependency @nuxtjs/i18n to ^8.5.3 ([#849](#849)) ([1689312](1689312)) * **deps:** update dependency @nuxtjs/robots to ^4.1.7 ([#861](#861)) ([4cf88c8](4cf88c8)) * **deps:** update dependency @primevue/nuxt-module to ^4.0.6 ([#841](#841)) ([7384c1e](7384c1e)) * **deps:** update dependency @primevue/nuxt-module to ^4.0.7 ([#854](#854)) ([22c3f4a](22c3f4a)) * **deps:** update dependency @stylistic/eslint-plugin to ^2.8.0 ([#838](#838)) ([1c15410](1c15410)) * **deps:** update dependency @types/qs to ^6.9.16 ([#868](#868)) ([8560a5d](8560a5d)) * **deps:** update dependency @vueuse/core to ^11.1.0 ([#875](#875)) ([b568680](b568680)) * **deps:** update dependency @vueuse/nuxt to ^11.1.0 ([#876](#876)) ([0f358b6](0f358b6)) * **deps:** update dependency circle-progress.vue to ^3.2.2 ([#878](#878)) ([4cd09ac](4cd09ac)) * **deps:** update dependency husky to ^9.1.6 ([#858](#858)) ([03b278b](03b278b)) * **deps:** update dependency msw to ^2.4.3 ([#827](#827)) ([6cd07ef](6cd07ef)) * **deps:** update dependency msw to ^2.4.4 ([#833](#833)) ([44814db](44814db)) * **deps:** update dependency msw to ^2.4.5 ([#850](#850)) ([773674a](773674a)) * **deps:** update dependency msw to ^2.4.6 ([#864](#864)) ([93b4a45](93b4a45)) * **deps:** update dependency msw to ^2.4.7 ([#871](#871)) ([b6cef68](b6cef68)) * **deps:** update dependency msw to ^2.4.8 ([#882](#882)) ([96d9d56](96d9d56)) * **deps:** update dependency node to v22.9.0 ([#886](#886)) ([8f28e99](8f28e99)) * **deps:** update dependency sass to ^1.79.1 ([#887](#887)) ([02e728a](02e728a)) * **deps:** update dependency semantic-release to ^24.1.1 ([#851](#851)) ([9a5d974](9a5d974)) * **deps:** update dependency tailwindcss to ^3.4.11 ([#857](#857)) ([74668ab](74668ab)) * **deps:** update dependency tailwindcss to ^3.4.12 ([#885](#885)) ([b2d182d](b2d182d)) * **deps:** update dependency tsx to ^4.19.1 ([#859](#859)) ([6e771c3](6e771c3)) * **deps:** update dependency type-fest to ^4.26.1 ([#829](#829)) ([7b715fd](7b715fd)) * **deps:** update dependency typescript to ^5.6.2 ([#839](#839)) ([69b99b1](69b99b1)) * **deps:** update dependency vue to ^3.5.4 ([#844](#844)) ([09fd254](09fd254)) * **deps:** update dependency vue to ^3.5.5 ([#865](#865)) ([13ae2b7](13ae2b7)) * **deps:** update dependency vue to ^3.5.6 ([#874](#874)) ([77302a2](77302a2)) * **deps:** update dependency vue-router to ^4.4.4 ([#847](#847)) ([23430aa](23430aa)) * **deps:** update dependency vue-router to ^4.4.5 ([#863](#863)) ([28a6c29](28a6c29)) * **deps:** update nuxtjs monorepo to ^3.13.2 ([#872](#872)) ([28e0e43](28e0e43)) * **deps:** update playwright monorepo to ^1.47.1 ([#866](#866)) ([ae9e014](ae9e014)) * **deps:** update pnpm to v9.10.0 ([#837](#837)) ([05be262](05be262)) * **deps:** update typescript-eslint monorepo to ^8.5.0 ([#840](#840)) ([b230013](b230013)) * **deps:** update typescript-eslint monorepo to ^8.6.0 ([#881](#881)) ([c291635](c291635)) * **deps:** update vitest monorepo to ^2.1.0 ([#862](#862)) ([b25b312](b25b312)) * **deps:** update vitest monorepo to ^2.1.1 ([#867](#867)) ([a1ad2f8](a1ad2f8)) * **screenshots:** missing screenshots for linux ([8bfa635](8bfa635))
🎉 This PR is included in version 1.32.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests