chore: add vitest/globals types, remove redundant vitest imports, fix pre-existing lint issues

This commit is contained in:
Ilia Mashkov
2026-04-24 08:38:00 +03:00
parent f0fccd55f1
commit d89dc2ee70
42 changed files with 116 additions and 130 deletions
+2 -3
View File
@@ -1,4 +1,3 @@
import { describe, it, expect } from 'vitest';
import { render, screen } from '@testing-library/react';
import { Input, Textarea } from './Input';
@@ -35,7 +34,7 @@ describe('Input', () => {
const input = screen.getByRole('textbox');
const errorId = input.getAttribute('aria-describedby');
expect(errorId).toBeTruthy();
expect(document.getElementById(errorId!)).toHaveTextContent('Required');
expect(document.getElementById(errorId as string)).toHaveTextContent('Required');
});
it('no aria-describedby when no error', () => {
render(<Input />);
@@ -100,7 +99,7 @@ describe('Textarea', () => {
const textarea = screen.getByRole('textbox');
const errorId = textarea.getAttribute('aria-describedby');
expect(errorId).toBeTruthy();
expect(document.getElementById(errorId!)).toHaveTextContent('Too short');
expect(document.getElementById(errorId as string)).toHaveTextContent('Too short');
});
it('no aria-describedby when no error', () => {
render(<Textarea />);
+1 -1
View File
@@ -1,4 +1,4 @@
import { useId, type InputHTMLAttributes, type TextareaHTMLAttributes } from 'react';
import { type InputHTMLAttributes, type TextareaHTMLAttributes, useId } from 'react';
import { cn } from '$shared/lib';
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {