chore: add vitest/globals types, remove redundant vitest imports, fix pre-existing lint issues
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user