feat/e2e-testing (#31)
All checks were successful
🚀 Release / release (push) Successful in 4m7s
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:
27
packages/ui/src/lib/inputs/InputCheckbox.svelte.ts
Normal file
27
packages/ui/src/lib/inputs/InputCheckbox.svelte.ts
Normal 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();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user