openpencil/tests/e2e/settings/mobile.spec.ts
Danila Poyarkov ea4b8e4b97 feat(settings): unify preferences and integration editors
Unify Settings navigation, credential drafts, translated form validation, and appearance controls. Add explicit WebMCP access modes and searchable MCP tool permissions while preserving execution and credential safeguards.
2026-09-15 16:34:05 +03:00

29 lines
1.3 KiB
TypeScript

import { expect, test } from '@playwright/test'
import { CanvasHelper } from '#tests/helpers/canvas'
for (const theme of ['light', 'dark']) {
test(`mobile settings navigation and storage actions in ${theme}`, async ({ page }) => {
await page.setViewportSize({ width: 390, height: 844 })
await page.goto('/?test')
await new CanvasHelper(page).waitForInit()
await page.evaluate(async (value) => {
const path = '/src/app/shell/theme.ts'
const themeModule = await import(path)
themeModule.useAppTheme().setTheme(value)
}, theme)
await page.keyboard.press(process.platform === 'darwin' ? 'Meta+,' : 'Control+,')
const dialog = page.getByTestId('app-settings-dialog')
await expect(dialog).toBeVisible()
const section = dialog.getByRole('combobox', { name: 'Settings', exact: true })
await section.click()
await page.getByRole('option', { name: 'AI & agents', exact: true }).click()
await expect(page.getByTestId('settings-ai-panel')).toBeVisible()
await expect(dialog).toHaveScreenshot(`mobile-settings-models-${theme}.png`)
await section.click()
await page.getByRole('option', { name: 'Cloud storage', exact: true }).click()
await expect(page.getByTestId('settings-storage-panel')).toBeVisible()
await expect(dialog).toHaveScreenshot(`mobile-settings-storage-${theme}.png`)
})
}