feat/e2e-testing (#31)
All checks were successful
🚀 Release / release (push) Successful in 4m7s

Reviewed-on: #31
Co-authored-by: Max Richter <max@max-richter.dev>
Co-committed-by: Max Richter <max@max-richter.dev>
This commit was merged in pull request #31.
This commit is contained in:
2026-02-03 22:29:43 +01:00
committed by max_richter
parent 01f1568221
commit 91866b4e9a
37 changed files with 1262 additions and 112 deletions

View File

@@ -0,0 +1,34 @@
import { describe, expect, it } from 'vitest';
import { render } from 'vitest-browser-svelte';
import { page } from 'vitest/browser';
import ShortCut from './ShortCut.svelte';
describe('ShortCut', () => {
it('should render with key label', async () => {
render(ShortCut, { key: 'S' });
const shortcut = page.getByText('S');
await expect.element(shortcut).toBeInTheDocument();
});
it('should render ctrl modifier', async () => {
render(ShortCut, { ctrl: true, key: 'S' });
const shortcut = page.getByText(/Ctrl/);
await expect.element(shortcut).toBeInTheDocument();
});
it('should render alt modifier', async () => {
render(ShortCut, { alt: true, key: 'F4' });
const shortcut = page.getByText(/Alt/);
await expect.element(shortcut).toBeInTheDocument();
});
it('should render multiple modifiers', async () => {
render(ShortCut, { ctrl: true, alt: true, key: 'Delete' });
const shortcut = page.getByText(/Ctrl/);
await expect.element(shortcut).toBeInTheDocument();
});
});