guanghu/tests/smoke/command-palette-hides-legacy-journal.spec.ts
冰朔 8739805f99
Some checks failed
Auto-update PR branches / Update open PR branches (push) Has been cancelled
CI / Frontend Static Quality Checks (push) Has been cancelled
CI / Frontend Tests & Coverage (push) Has been cancelled
CI / Rust Tests & Quality Checks (push) Has been cancelled
CI / Linux build verification (push) Has been cancelled
Release (Alpha) / Compute alpha version (push) Has been cancelled
Release (Alpha) / Build release artifacts (push) Has been cancelled
Release (Alpha) / GitHub Release (alpha) (push) Has been cancelled
Release (Alpha) / Update docs and release pages (push) Has been cancelled
Deploy docs / Build VitePress site (push) Has been cancelled
Deploy docs / Deploy to GitHub Pages (push) Has been cancelled
光湖开源源码快照 · Tolaria AGPL 分叉基线 · 独立更新链
2026-07-05 17:45:16 +08:00

55 lines
1.4 KiB
TypeScript

import fs from 'fs'
import path from 'path'
import { test, expect } from '@playwright/test'
import {
createFixtureVaultCopy,
openFixtureVault,
removeFixtureVaultCopy,
} from '../helpers/fixtureVault'
import { openCommandPalette } from './helpers'
let tempVaultDir: string
function seedExplicitJournalTypeVault(vaultPath: string): void {
fs.writeFileSync(path.join(vaultPath, 'journal.md'), `---
type: Type
order: 12
icon: book-bookmark
color: yellow
---
# Journal
`)
fs.writeFileSync(path.join(vaultPath, 'daily-log.md'), `---
title: Daily Log
type: Journal
---
# Daily Log
`)
}
test.describe('explicit Journal type stays visible across navigation surfaces', () => {
test.beforeEach(() => {
tempVaultDir = createFixtureVaultCopy()
seedExplicitJournalTypeVault(tempVaultDir)
})
test.afterEach(() => {
removeFixtureVaultCopy(tempVaultDir)
})
test('explicit Journal type appears in the sidebar and command palette', async ({ page }) => {
await openFixtureVault(page, tempVaultDir)
await expect(page.locator('nav').getByText('Journals', { exact: true })).toBeVisible()
await openCommandPalette(page)
await page.locator('input[placeholder="Type a command..."]').fill('journal')
await expect(page.getByText('List Journals', { exact: true })).toBeVisible()
await expect(page.getByText('New Journal', { exact: true })).toBeVisible()
})
})