From 77a465b9725e4958be5ee651644df1f1b754b9f0 Mon Sep 17 00:00:00 2001 From: eric2788 Date: Sun, 10 Mar 2024 22:22:06 +0800 Subject: [PATCH] fixup! optimized superchat feature and fixed only vtuber mechanism --- src/settings/features/superchat/index.tsx | 2 +- tests/features/superchat.spec.ts | 2 +- tests/pages/settings.spec.ts | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/settings/features/superchat/index.tsx b/src/settings/features/superchat/index.tsx index c1aab52f..0d16b659 100644 --- a/src/settings/features/superchat/index.tsx +++ b/src/settings/features/superchat/index.tsx @@ -35,7 +35,7 @@ function SuperchatFeatureSettings({ state, useHandler }: StateProxy
在全屏模式下显示 diff --git a/tests/features/superchat.spec.ts b/tests/features/superchat.spec.ts index a8550644..f4f7f65e 100644 --- a/tests/features/superchat.spec.ts +++ b/tests/features/superchat.spec.ts @@ -199,7 +199,7 @@ test('測試全屏時有否根據設定顯示隱藏浮動按鈕', async ({ conte const settingsPage = await context.newPage() await settingsPage.goto(tabUrl('settings.html'), { waitUntil: 'domcontentloaded' }) await settingsPage.getByText('功能设定').click() - await settingsPage.getByText('在全屏模式下显示').click() // closed + await settingsPage.getByTestId('superchat-display-fullscreen').click() // closed await settingsPage.getByText('保存设定').click() await settingsPage.close() diff --git a/tests/pages/settings.spec.ts b/tests/pages/settings.spec.ts index 48036f9a..ccf707dd 100644 --- a/tests/pages/settings.spec.ts +++ b/tests/pages/settings.spec.ts @@ -28,7 +28,7 @@ test('測試能否保存設定', async ({ settings: page }) => { await page.getByText('功能设定').click() const chexkboxVtbOnly = page.getByTestId('vtb-only') - await expect(chexkboxVtbOnly).not.toBeChecked() + await expect(chexkboxVtbOnly).toBeChecked() await page.getByText('仅限虚拟主播').click() const checkboxMonitor = page.getByTestId('monitor-window') @@ -71,7 +71,7 @@ test('測試能否保存設定', async ({ settings: page }) => { logger.info('正在验证功能設定....') await page.getByText('功能设定').click() - await expect(chexkboxVtbOnly).toBeChecked() + await expect(chexkboxVtbOnly).not.toBeChecked() await expect(checkboxMonitor).toBeChecked() await expect(inputSubtitleSize).toHaveValue('20') await expect(inputFirstSubtitleSize).toHaveValue('22') @@ -96,7 +96,7 @@ test('測試導出導入設定', async ({ settings: page }) => { await page.getByText('功能设定').click() const chexkboxVtbOnly = page.getByTestId('vtb-only') - await expect(chexkboxVtbOnly).not.toBeChecked() + await expect(chexkboxVtbOnly).toBeChecked() await page.getByText('仅限虚拟主播').click() const checkboxMonitor = page.getByTestId('monitor-window') @@ -120,7 +120,7 @@ test('測試導出導入設定', async ({ settings: page }) => { logger.info('正在验证功能設定....') await page.getByText('功能设定').click() - await expect(chexkboxVtbOnly).toBeChecked() + await expect(chexkboxVtbOnly).not.toBeChecked() await expect(checkboxMonitor).toBeChecked() await expect(inputSubtitleSize).toHaveValue('20') await expect(inputFirstSubtitleSize).toHaveValue('22') @@ -135,7 +135,7 @@ test('測試導出導入設定', async ({ settings: page }) => { await page.getByText('设定已经导入成功。').waitFor({ state: 'visible' }) logger.info('正在验证功能設定....') - await expect(chexkboxVtbOnly).not.toBeChecked() + await expect(chexkboxVtbOnly).toBeChecked() await expect(checkboxMonitor).not.toBeChecked() await expect(inputSubtitleSize).toHaveValue('16') await expect(inputFirstSubtitleSize).toHaveValue('18')