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>
28 lines
849 B
TypeScript
28 lines
849 B
TypeScript
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();
|
|
});
|
|
});
|