diff --git a/apps/desktop/e2e/settings.spec.ts b/apps/desktop/e2e/settings.spec.ts index 9340705a17..f44870fed9 100644 --- a/apps/desktop/e2e/settings.spec.ts +++ b/apps/desktop/e2e/settings.spec.ts @@ -5,30 +5,6 @@ function settingsNavigation(page: Page) { return page.getByRole('navigation', { name: /^(设置分组|Settings sections)$/ }); } -/** - * Settings take effect: open settings, switch the theme to dark, and confirm - * the root picks up the `dark` class (theme.ts applies it via - * classList.toggle). This exercises the settings open → navigate → mutate → - * apply path without depending on pixel colors. - */ -test('changing the theme in settings applies to the UI', async ({ window: page }) => { - await page.getByRole('button', { name: '展开侧边栏' }).click(); - await page.getByRole('button', { name: '设置' }).click(); - await expect(page.getByLabel('设置内容')).toBeVisible(); - - await settingsNavigation(page).getByRole('button', { name: '外观', exact: true }).click(); - const themeGroup = page.getByRole('radiogroup', { name: '主题' }); - const lightTheme = themeGroup.getByRole('radio', { name: '浅色' }); - const darkTheme = themeGroup.getByRole('radio', { name: '深色' }); - await lightTheme.focus(); - await lightTheme.press('ArrowDown'); - await expect(darkTheme).toBeChecked(); - - await expect.poll( - async () => page.evaluate(() => document.documentElement.classList.contains('dark')), - ).toBe(true); -}); - test('remote access prioritizes a configured channel that needs attention', async ({ window: page }) => { const runtimeError = 'runtime-diagnostic-'.repeat(10); await page.evaluate(async (lastError) => { diff --git a/apps/desktop/stories/settings/settings-pages.stories.tsx b/apps/desktop/stories/settings/settings-pages.stories.tsx index adc29828dc..8dfbff07f9 100644 --- a/apps/desktop/stories/settings/settings-pages.stories.tsx +++ b/apps/desktop/stories/settings/settings-pages.stories.tsx @@ -814,8 +814,11 @@ function assertDailyReviewSettingsBounds( ): void { const time = canvasElement.querySelector('input[type="text"]'); const page = canvasElement.querySelector('.settingsFormPage'); - const timeForm = time?.closest('.settingsFormLayout'); - const selectorForm = selector.closest('.settingsFormLayout'); + // The rows kit (#1972) retired `.settingsFormLayout`. A control now lives in + // its row's capped end slot, so `.settingsRowEnd` is the container this + // contract has always meant: the bound the control must not overflow. + const timeForm = time?.closest('.settingsRowEnd'); + const selectorForm = selector.closest('.settingsRowEnd'); const listbox = document.querySelector('[role="listbox"]'); const popover = listbox?.closest('[popover]'); if (!time || !page || !timeForm || !selectorForm || !popover) {