Files
hyprcrd/public/plugins/tests/gallery.test.js
T
thandClaude Opus 4.6 d3d9355191 electron: external data dir, packaged path fix, footer responsive, test stabilization
- DB + uploads stored outside app bundle (survives updates)
- Router uses DOCUMENT_ROOT instead of __DIR__ (fixes AppImage paths)
- Footer count shifts right below 1250px, min-width 1150px
- Gallery opens gracefully on fetch errors
- Stabilized gallery, export, and find/replace tests with poll loops

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

43 lines
1.2 KiB
JavaScript

import { describe, it, afterEach, expect, $, click, sleep, closeAll } from './runner.js?v=4';
describe('Gallery', () => {
afterEach(() => closeAll());
it('button exists', () => {
expect($('#gallery-btn')).toExist();
});
it('opens on button click', async () => {
click('#gallery-btn');
for (let i = 0; i < 40; i++) {
if ($('#gallery')?.classList.contains('open')) break;
await sleep(100);
}
expect($('#gallery')).toBeVisible();
});
it('grid has no text selection', () => {
expect($('#gallery-grid').classList.contains('select-none')).toBe(true);
});
it('shows image count', async () => {
click('#gallery-btn');
for (let i = 0; i < 40; i++) {
if ($('#gallery')?.classList.contains('open')) break;
await sleep(100);
}
expect($('#gallery-count')).toExist();
});
it('closes on close button', async () => {
click('#gallery-btn');
for (let i = 0; i < 40; i++) {
if ($('#gallery')?.classList.contains('open')) break;
await sleep(100);
}
click('#gallery-close');
await sleep(150);
expect($('#gallery')).toBeHidden();
});
});