* runner.js: shows a 30px fixed-top progress strip during runs (label "test x/total:", current suite/test name with ellipsis on the left, fixed 50%-wide progress fill on the right that turns danger-red on the first failure). The DOM node is created in loader.js so it appears immediately on shortcut press; runner.js only updates it. The fill width is fixed at flex:0 0 50% so it doesn't jiggle as the test name changes length. Suites now live on window._testSuites as a defensive fallback so two runner instances stay in sync. * Cache invalidation: every test file's `from './runner.js'` is now `from './runner.js?v=2'`, and loader.js imports the runner with the same RUNNER_V suffix. Same URL → one module instance → suite registration and runAll see the same array. Bumping RUNNER_V (in loader.js + every test file in lock-step) is the way to force a re-fetch when runner.js changes. * loader.js: ensureProgressBar() draws the strip via setProperty(..., 'important') with z-index 2147483647 attached to documentElement so nothing in user CSS, scanline overlay (z 9999) or modals can occlude it. Auto-run path (?test=1) also pre-renders the strip. chore: bump version to 0.9.1 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
75 lines
2.6 KiB
JavaScript
75 lines
2.6 KiB
JavaScript
import { describe, it, expect } from './runner.js?v=2';
|
|
import { renderMd } from '../../js/modules/markdown.js';
|
|
|
|
describe('Markdown: Blank Lines', () => {
|
|
it('image after blank lines renders', () => {
|
|
const html = renderMd('text\n\n\n\n');
|
|
expect(html).toContain('<img');
|
|
expect(html).toContain('uploads/test.jpg');
|
|
});
|
|
|
|
it('image after single blank line renders', () => {
|
|
const html = renderMd('text\n\n');
|
|
expect(html).toContain('<img');
|
|
});
|
|
|
|
it('image after many blank lines renders', () => {
|
|
const html = renderMd('text\n\n\n\n\n\n');
|
|
expect(html).toContain('<img');
|
|
});
|
|
|
|
it('heading after blank lines renders', () => {
|
|
const html = renderMd('text\n\n\n\n## Heading');
|
|
expect(html).toContain('<h2');
|
|
});
|
|
|
|
it('list after blank lines renders', () => {
|
|
const html = renderMd('text\n\n\n\n- item one\n- item two');
|
|
expect(html).toContain('<li');
|
|
});
|
|
|
|
it('code block after blank lines renders', () => {
|
|
const html = renderMd('text\n\n\n\n```\ncode\n```');
|
|
expect(html).toContain('<code');
|
|
});
|
|
|
|
it('hr after blank lines renders', () => {
|
|
const html = renderMd('text\n\n\n\n---');
|
|
expect(html).toContain('<hr');
|
|
});
|
|
|
|
it('todo after blank lines renders', () => {
|
|
const html = renderMd('text\n\n\n\n- [ ] task');
|
|
expect(html).toContain('checkbox');
|
|
});
|
|
|
|
it('wiki link after blank lines renders', () => {
|
|
const html = renderMd('text\n\n\n\n[[Some Card]]');
|
|
expect(html).toContain('card-link');
|
|
});
|
|
|
|
it('gallery block after blank lines renders', () => {
|
|
const html = renderMd('text\n\n\n\n```gallery\n\n```');
|
|
expect(html).toContain('md-gallery');
|
|
});
|
|
|
|
it('multiple blank lines produce spacing but no broken content', () => {
|
|
const html = renderMd('para 1\n\n\n\npara 2\n\n\n\n\npara 3');
|
|
// All three paragraphs should render
|
|
const pCount = (html.match(/<p>/g) || []).length;
|
|
expect(pCount).toBeGreaterThan(1);
|
|
});
|
|
|
|
it('blank lines between images both render', () => {
|
|
const html = renderMd('\n\n\n\n');
|
|
const imgCount = (html.match(/<img/g) || []).length;
|
|
expect(imgCount).toBe(2);
|
|
});
|
|
|
|
it('blank lines dont break bold/italic', () => {
|
|
const html = renderMd('**bold text**\n\n\n\n*italic text*');
|
|
expect(html).toContain('<strong>bold text</strong>');
|
|
expect(html).toContain('<em>italic text</em>');
|
|
});
|
|
});
|