From 168bb5d5c04a9d7149f9fab47bb023d92b834d96 Mon Sep 17 00:00:00 2001 From: DorraJaouad Date: Tue, 12 Sep 2023 14:32:07 +0200 Subject: [PATCH] Add tests and renaming Signed-off-by: DorraJaouad --- src/components/ChatView.vue | 4 +- src/components/GuestWelcomeWindow.vue | 18 +++--- src/components/LobbyScreen.vue | 4 +- src/components/SetGuestUsername.vue | 4 +- src/stores/__tests__/guestName.spec.js | 78 ++++++++++++++++++++++++++ src/stores/guestName.js | 2 +- 6 files changed, 94 insertions(+), 16 deletions(-) diff --git a/src/components/ChatView.vue b/src/components/ChatView.vue index 96b17399d54..7d338ba9944 100644 --- a/src/components/ChatView.vue +++ b/src/components/ChatView.vue @@ -23,7 +23,7 @@ @dragover.prevent="handleDragOver" @dragleave.prevent="handleDragLeave" @drop.prevent="handleDropFiles"> - +
@@ -113,7 +113,7 @@ export default { return this.$store.getters.getActorType() === 'guests' }, - isGuestAndhasNotUsername() { + isGuestWithoutDisplayName() { const userName = this.$store.getters.getDisplayName() return !userName && this.isGuest }, diff --git a/src/components/GuestWelcomeWindow.vue b/src/components/GuestWelcomeWindow.vue index 4f6bf72bc68..6d489b78694 100644 --- a/src/components/GuestWelcomeWindow.vue +++ b/src/components/GuestWelcomeWindow.vue @@ -36,20 +36,20 @@ {{ conversationDescription }}

-

- {{ t('spreed', 'Enter your name') }} -

- - {{ t('spreed', 'Enter your name') }} + - {{ submitMessage }} + {{ t('spreed', 'Submit name and join') }} @@ -115,14 +115,14 @@ export default { return this.conversation?.description }, - submitMessage() { - return t('spreed', 'Submit name and join') + invalidGuestUsername() { + return this.guestUserName.trim() === '' }, }, methods: { handleChooseUserName() { - this.guestNameStore.submitUserName(this.token, this.guestUserName) + this.guestNameStore.submitGuestUsername(this.token, this.guestUserName) }, }, } diff --git a/src/components/LobbyScreen.vue b/src/components/LobbyScreen.vue index 395e95804cf..d07b956d954 100644 --- a/src/components/LobbyScreen.vue +++ b/src/components/LobbyScreen.vue @@ -20,7 +20,7 @@