Files
hyprcrd/public/plugins/tests/detail.test.js
T
thandClaude Opus 4.6 088c225202 runner: bump RUNNER_V ?v=3 → ?v=4 so test-shield removal loads
The test-shield (#test-shield) was added in loader.js (always fresh
via plugin manager ?v=time()) but the removal lives in runner.js
hideProgress(). runner.js was still cached at ?v=3 in the browser,
so the shield stayed after the run. Bumping to ?v=4 in loader.js +
all 42 test files forces a fresh runner.js load.

chore: bump version to 0.9.15

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 11:04:23 +02:00

70 lines
2.1 KiB
JavaScript

import { describe, it, afterEach, expect, $, click, pressKey, sleep, closeAll } from './runner.js?v=4';
describe('Detail View', () => {
afterEach(() => closeAll());
it('has structural elements', () => {
for (const id of ['detail', 'detail-title', 'detail-body', 'detail-meta', 'detail-tags']) {
expect($(`#${id}`)).toExist();
}
});
it('has control buttons', () => {
for (const id of ['detail-edit', 'detail-delete', 'detail-done', 'detail-zen', 'detail-close']) {
expect($(`#${id}`)).toExist();
}
});
it('opens on card click (non-split)', async () => {
if (!$('#board-preview')?.classList.contains('hidden')) {
click('#board-split-toggle');
await sleep(100);
}
const card = $('#board [data-id]');
if (!card) return;
click(card);
await sleep(300);
expect($('#detail')).toBeVisible();
});
it('shows card title', async () => {
if (!$('#board-preview')?.classList.contains('hidden')) {
click('#board-split-toggle');
await sleep(100);
}
const card = $('#board [data-id]');
if (!card) return;
click(card);
await sleep(300);
expect($('#detail-title').textContent.length).toBeGreaterThan(0);
});
it('closes on ESC', async () => {
if (!$('#board-preview')?.classList.contains('hidden')) {
click('#board-split-toggle');
await sleep(100);
}
const card = $('#board [data-id]');
if (!card) return;
click(card);
await sleep(300);
pressKey('Escape');
await sleep(150);
expect($('#detail')).toBeHidden();
});
it('closes on close button', async () => {
if (!$('#board-preview')?.classList.contains('hidden')) {
click('#board-split-toggle');
await sleep(100);
}
const card = $('#board [data-id]');
if (!card) return;
click(card);
await sleep(300);
click('#detail-close');
await sleep(150);
expect($('#detail')).toBeHidden();
});
});