guanghu/tests/smoke/generate-commit-message.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

25 lines
1.1 KiB
TypeScript

import { expect, test } from '@playwright/test'
import { executeCommand, openCommandPalette, sendShortcut } from './helpers'
test.setTimeout(60_000)
test('command palette generates an editable commit message from the current diff', async ({ page }) => {
await page.goto('/', { timeout: 45_000, waitUntil: 'domcontentloaded' })
await expect(page.getByRole('heading', { name: 'Inbox' })).toBeVisible({ timeout: 20_000 })
await openCommandPalette(page)
await executeCommand(page, 'Generate Commit Message from Diff')
const messageInput = page.locator('textarea[placeholder="Commit message..."]')
await expect(page.getByRole('heading', { name: 'Commit & Push' })).toBeVisible()
await expect(messageInput).toHaveValue('Update 4 notes', { timeout: 5_000 })
await expect(messageInput).toBeFocused()
await expect(page.getByRole('button', { name: 'Commit & Push' })).toBeEnabled()
await sendShortcut(page, 'a', ['Control'])
await page.keyboard.type('Update generated commit draft')
await sendShortcut(page, 'Enter', ['Control'])
await expect(page.locator('.fixed.bottom-8')).toContainText('Committed and pushed', { timeout: 5_000 })
})