Skip to content

Commit 837e6fb

Browse files
committed
fixup! fixup! fixup! fixup! fixup! e2e test
1 parent 3aa6bb6 commit 837e6fb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/components/ChatBubble.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ function ChatBubble(props: ChatBubbleProps): JSX.Element {
2323
<div className="flex gap-2.5 mb-4">
2424
<Avatar src={avatar} />
2525
<div className="grid">
26-
<h5 className="text-gray-900 text-sm font-semibold leading-snug pb-1">{name}</h5>
26+
<h5 data-testid={`${name}-bubble-username`} className="text-gray-900 text-sm font-semibold leading-snug pb-1">{name}</h5>
2727
{messages.map((message, index) => (
2828
<div key={index} className="max-w-full grid">
29-
<div className="px-3.5 py-2 bg-gray-100 rounded justify-start items-center gap-3 inline-flex">
29+
<div data-testid={`${name}-bubble-chat-${index}`} className="px-3.5 py-2 bg-gray-100 rounded justify-start items-center gap-3 inline-flex">
3030
<h5 className={`text-gray-900 text-sm font-normal leading-snug ${loading ? 'animate-pulse' : ''}`}>{message.text}</h5>
3131
</div>
3232
{message.time && (
33-
<div className="justify-end items-center inline-flex mb-2.5">
33+
<div data-testid={`${name}-bubble-time-${index}`} className="justify-end items-center inline-flex mb-2.5">
3434
<h6 className="text-gray-500 text-xs font-normal leading-4 py-1">{message.time}</h6>
3535
</div>
3636
)}

tests/features/jimaku.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ test('测试同传字幕AI总结', { tag: "@scoped" }, async ({ room, content: p
202202
logger.info('正在測試AI总結結果... (15s)')
203203
await summarizer.waitForTimeout(15000)
204204
await expect(summarizer.getByText('错误')).toBeHidden({ timeout: 5000 })
205-
const res = await summarizer.locator('h5.leading-snug').textContent()
205+
const res = await summarizer.getByTestId('同传字幕总结-bubble-chat-0').locator('h5.leading-snug').textContent()
206206
logger.debug('AI Summary:', res)
207207

208208
const maybe = expect.configure({ soft: true })

0 commit comments

Comments
 (0)