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,27 @@
import { describe, expect, it } from 'vitest';
import { render } from 'vitest-browser-svelte';
import { page } from 'vitest/browser';
import InputCheckbox from './InputCheckbox.svelte';
describe('InputCheckbox', () => {
it('should render checkbox label', async () => {
render(InputCheckbox, { value: false });
const checkbox = page.getByRole('checkbox');
await expect.element(checkbox).toBeInTheDocument();
});
it('should be unchecked when value is false', async () => {
render(InputCheckbox, { value: false });
const input = page.getByRole('checkbox');
await expect.element(input).not.toBeChecked();
});
it('should be checked when value is true', async () => {
render(InputCheckbox, { value: true });
const input = page.getByRole('checkbox');
await expect.element(input).toBeChecked();
});
});