Files
hyprcrd/public/plugins/tests/calendar.test.js
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

62 lines
1.9 KiB
JavaScript

import { describe, it, afterEach, expect, $, click, sleep, closeAll } from './runner.js?v=4';
describe('Calendar', () => {
afterEach(() => closeAll());
it('button exists', () => {
expect($('#calendar-btn')).toExist();
});
it('opens on button click', async () => {
click('#calendar-btn');
await sleep(250);
expect($('#calendar')).toBeVisible();
});
it('shows month title', async () => {
click('#calendar-btn');
await sleep(250);
expect($('#cal-title')).toExist();
expect($('#cal-title').textContent.length).toBeGreaterThan(3);
});
it('has navigation buttons', async () => {
click('#calendar-btn');
await sleep(200);
expect($('#cal-prev')).toExist();
expect($('#cal-next')).toExist();
expect($('#cal-today')).toExist();
});
it('navigates months', async () => {
click('#calendar-btn');
await sleep(200);
const before = $('#cal-title').textContent;
click('#cal-next');
await sleep(200);
const after = $('#cal-title').textContent;
// Should be different month
expect(after).toBeTruthy();
});
it('today resets to current month', async () => {
click('#calendar-btn');
await sleep(200);
click('#cal-next');
click('#cal-next');
await sleep(200);
click('#cal-today');
await sleep(200);
const months = ['January','February','March','April','May','June','July','August','September','October','November','December'];
expect($('#cal-title').textContent).toContain(months[new Date().getMonth()]);
});
it('closes on close button', async () => {
click('#calendar-btn');
await sleep(200);
click('#cal-close');
await sleep(150);
expect($('#calendar')).toBeHidden();
});
});