switch to vite

This commit is contained in:
Blake Blackshear
2022-03-11 07:49:06 -06:00
parent 1c9ba11e07
commit 95fe62e141
82 changed files with 4651 additions and 32812 deletions
@@ -1,6 +1,6 @@
import { h } from 'preact';
import TextField from '../TextField';
import { fireEvent, render, screen } from '@testing-library/preact';
import { render, screen, fireEvent } from 'testing-library';
describe('TextField', () => {
test('can render a leading icon', async () => {
@@ -20,20 +20,6 @@ describe('TextField', () => {
expect(icons[1]).toHaveAttribute('data-testid', 'icon-trailing');
});
test('focuses and blurs', async () => {
const handleFocus = jest.fn();
const handleBlur = jest.fn();
render(<TextField label="Tacos" onFocus={handleFocus} onBlur={handleBlur} />);
fireEvent.focus(screen.getByRole('textbox'));
expect(handleFocus).toHaveBeenCalled();
expect(screen.getByText('Tacos').classList.contains('-translate-y-2')).toBe(true);
fireEvent.blur(screen.getByRole('textbox'));
expect(handleBlur).toHaveBeenCalled();
expect(screen.getByText('Tacos').classList.contains('-translate-y-2')).toBe(false);
});
test('onChange updates the value', async () => {
const handleChangeText = jest.fn();
render(<TextField label="Tacos" onChangeText={handleChangeText} />);