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,8 +1,7 @@
import { describe, it, expect, vi } from 'vitest';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { MobileNav } from './MobileNav';
import type { NavItem } from '../model/types';
import { MobileNav } from './MobileNav';
const ITEMS: NavItem[] = [{ id: 'about', label: 'About', number: '01' }];
@@ -38,7 +37,7 @@ describe('MobileNav', () => {
// item button label contains number + label text; find by accessible name fragment
const itemBtn = screen.getAllByRole('button').find((b) => b.textContent?.includes('About'));
expect(itemBtn).toBeDefined();
await userEvent.click(itemBtn!);
await userEvent.click(itemBtn as HTMLElement);
expect(screen.queryByText('Close')).not.toBeInTheDocument();
expect(screen.getByRole('button', { name: 'Menu' })).toBeInTheDocument();
});