guanghu/tests/smoke/non-git-vault-init.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

33 lines
1.5 KiB
TypeScript

import { test, expect } from '@playwright/test'
import { createFixtureVaultCopy, openFixtureVault, removeFixtureVaultCopy } from '../helpers/fixtureVault'
import { executeCommand, openCommandPalette } from './helpers'
test('opens a non-git vault and initializes Git later from the keyboard @smoke', async ({ page }) => {
const tempVaultDir = createFixtureVaultCopy()
try {
await openFixtureVault(page, tempVaultDir, { isGitRepo: false })
await expect(page.getByTestId('note-list-container')).toBeVisible()
await expect(page.getByText('Alpha Project', { exact: true }).first()).toBeVisible()
await expect(page.getByRole('heading', { name: 'Enable Git for this vault?' })).toBeVisible()
await page.keyboard.press('Escape')
await expect(page.getByRole('heading', { name: 'Enable Git for this vault?' })).not.toBeVisible()
await expect(page.getByTestId('status-missing-git')).toContainText('Git disabled')
await openCommandPalette(page)
await executeCommand(page, 'Initialize Git')
await expect(page.getByRole('heading', { name: 'Enable Git for this vault?' })).toBeVisible()
await page.getByRole('button', { name: 'Initialize Git' }).focus()
await page.keyboard.press('Enter')
await expect(page.getByRole('heading', { name: 'Enable Git for this vault?' })).not.toBeVisible()
await expect(page.getByTestId('status-missing-git')).not.toBeVisible()
await expect(page.getByTestId('status-pulse')).toBeVisible()
} finally {
removeFixtureVaultCopy(tempVaultDir)
}
})