Skip to content

Commit

Permalink
Fix e2e (#419)
Browse files Browse the repository at this point in the history
* init

* chat-message class

* add import

* chat message class

* fmt

* Revert "fmt"

This reverts commit 88b195c.

* revert go change

* fmt
  • Loading branch information
swuecho authored Apr 22, 2024
1 parent f74c831 commit 95a55aa
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
1 change: 0 additions & 1 deletion api/chat_user_active_chat_session_sevice.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"context"
"errors"

"github.com/rotisserie/eris"
sqlc "github.com/swuecho/chat_backend/sqlc_queries"
)
Expand Down
2 changes: 2 additions & 0 deletions e2e/tests/02_simpe_prompt.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ test('test', async ({ page }) => {
await page.getByTestId('repwd').locator('input').click();
await page.getByTestId('repwd').locator('input').fill('@ThisIsATestPass5');
await page.getByTestId('signup').click();
await page.waitForTimeout(2000);

// locate by id #message_texarea and click
// Find the element by Id and click on it
//const messageTextArea = await page.$('#message_texarea');
//await messageTextArea?.click();
//await messageTextArea?.fill('test_demo_bestqa');
await page.getByTestId("message_textarea").click()
await page.waitForTimeout(1000);
const input_area = await page.$("#message_textarea textarea")
await input_area?.fill('test_demo_bestqa');
// await page.fill("#message_textarea", 'test_demo_bestqa');
Expand Down
1 change: 1 addition & 0 deletions web/src/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"new": "New Chat",
"placeholder": "What would you like to say... (Shift + Enter = newline, '/' to trigger prompts)",
"placeholderMobile": "What would you like to say...",
"playAudio": "audio",
"presencePenalty": "Presence Penalty",
"sessionConfig": "Conversation Settings:",
"snapshotSuccess": "Snapshot successful, please view in a new tab",
Expand Down
4 changes: 3 additions & 1 deletion web/src/views/chat/components/Message/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ function handleRegenerate() {
</script>

<template>
<div class="chat-message">
<p class="text-xs text-[#b4bbc4] text-center">{{ displayLocaleDate(dateTime) }}</p>
<div class="flex w-full mb-6 overflow-hidden chat-message" :class="[{ 'flex-row-reverse': inversion }]">
<div class="flex w-full mb-6 overflow-hidden" :class="[{ 'flex-row-reverse': inversion }]">
<div class="flex items-center justify-center flex-shrink-0 h-8 overflow-hidden rounded-full basis-8"
:class="[inversion ? 'ml-2' : 'mr-2']">
<AvatarComponent :inversion="inversion" :model="model" />
Expand Down Expand Up @@ -128,4 +129,5 @@ function handleRegenerate() {
<AudioPlayer :text="text || ''" :right="inversion"></AudioPlayer>
</div>
</div>
</div>
</template>
2 changes: 1 addition & 1 deletion web/src/views/chat/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ function getDataFromResponseText(responseText: string): string {
</template>
<template v-else>
<div>
<Message v-for="(item, index) of dataSources" :key="index" :date-time="item.dateTime"
<Message v-for="(item, index) of dataSources" :key="index" :date-time="item.dateTime"
:model="chatSession?.model" :text="item.text" :inversion="item.inversion" :error="item.error"
:is-prompt="item.isPrompt" :is-pin="item.isPin" :loading="item.loading" :pining="pining" :index="index"
@regenerate="onRegenerate(index)" @delete="handleDelete(index)" @toggle-pin="handleTogglePin(index)"
Expand Down

0 comments on commit 95a55aa

Please sign in to comment.