guanghu/tests/smoke/telemetry-consent.spec.ts
Guanghu Domestic Migration 9b41d51231
Some checks are pending
Auto-update PR branches / Update open PR branches (push) Waiting to run
CI / Frontend Static Quality Checks (push) Waiting to run
CI / Frontend Tests & Coverage (push) Waiting to run
CI / Rust Tests & Quality Checks (push) Waiting to run
CI / Linux build verification (push) Waiting to run
Deploy docs / Build VitePress site (push) Waiting to run
Deploy docs / Deploy to GitHub Pages (push) Blocked by required conditions
Release (Alpha) / Compute alpha version (push) Waiting to run
Release (Alpha) / Build release artifacts (push) Blocked by required conditions
Release (Alpha) / GitHub Release (alpha) (push) Blocked by required conditions
Release (Alpha) / Update docs and release pages (push) Blocked by required conditions
chore: import sanitized domestic snapshot for REPO-004
Source snapshot: 514ab1975951d94342ea38e64101d5a0f1c51c77
2026-07-17 15:55:28 +08:00

26 lines
1.0 KiB
TypeScript

import { test, expect } from '@playwright/test'
test.describe('Telemetry consent dialog', () => {
test('dialog does not appear when consent was already given', async ({ page }) => {
// Default mock settings have telemetry_consent: false
// The consent dialog should NOT appear (only appears when null)
await page.goto('/')
await page.waitForLoadState('networkidle')
await expect(page.getByText('Help improve Tolaria')).not.toBeVisible({ timeout: 5000 })
})
test('privacy toggles are visible in settings panel', async ({ page }) => {
await page.goto('/')
await page.waitForLoadState('networkidle')
// Open settings via keyboard shortcut
await page.keyboard.press('Meta+,')
await expect(page.getByTestId('settings-panel')).toBeVisible({ timeout: 5000 })
// Privacy section should be present
await expect(page.getByText('Privacy & Telemetry')).toBeVisible()
await expect(page.getByTestId('settings-crash-reporting')).toBeVisible()
await expect(page.getByTestId('settings-analytics')).toBeVisible()
})
})