Files
tolaria/tests/smoke/visible-type-property.spec.ts
Test 1706300494 test: add Playwright smoke test for visible type property
Also updates vite.config.ts vault API parser to include all VaultEntry
fields (visible, icon, color, order, etc.) so the dev server returns
complete entries for sidebar filtering.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 21:52:40 +01:00

40 lines
1.3 KiB
TypeScript

import { test, expect } from '@playwright/test'
test.describe('Type visibility in sidebar', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/')
await page.waitForLoadState('networkidle')
})
test('sections with visible:false Type entries are hidden from sidebar', async ({
page,
}) => {
const sidebar = page.locator('.app__sidebar')
// Wait for sections to render
await sidebar
.locator('button[aria-label*="Collapse"], button[aria-label*="Expand"]')
.first()
.waitFor({ timeout: 5000 })
// Extract section labels from Expand/Collapse buttons
const buttons = sidebar.locator(
'button[aria-label*="Collapse"], button[aria-label*="Expand"]',
)
const count = await buttons.count()
const labels: string[] = []
for (let i = 0; i < count; i++) {
const ariaLabel = await buttons.nth(i).getAttribute('aria-label')
const label = ariaLabel?.replace(/^(Collapse|Expand)\s+/, '') ?? ''
if (label) labels.push(label)
}
// Verify that at least some sections render (sanity check)
expect(labels.length).toBeGreaterThan(3)
// All visible section labels should be unique (regression check)
const uniqueLabels = [...new Set(labels)]
expect(labels).toEqual(uniqueLabels)
})
})