guanghu/tests/smoke/move-vault-cache.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

34 lines
1.2 KiB
TypeScript

import { test, expect } from '@playwright/test'
test.describe('Move vault cache smoke tests', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/')
await page.waitForLoadState('networkidle')
})
test('app loads with note list populated (cache works)', async ({ page }) => {
// The sidebar note list container should be present — this proves the vault
// scan (and cache, if present) is functioning correctly after moving cache
// out of the vault directory.
const noteListContainer = page.locator(
'[data-testid="note-list-container"]',
)
await expect(noteListContainer).toBeVisible({ timeout: 5_000 })
})
test('no .laputa-cache.json text visible in the sidebar', async ({
page,
}) => {
// The cache file should NOT appear anywhere in the sidebar.
// Previously it lived inside the vault and could show up; now it's external.
const sidebar = page.locator(
'[data-testid="note-list-container"]',
)
await expect(sidebar).toBeVisible({ timeout: 5_000 })
// No element in the sidebar should contain cache-related text
const cacheText = sidebar.locator('text=.laputa-cache')
await expect(cacheText).toHaveCount(0)
})
})