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 -2
View File
@@ -1,2 +1,2 @@
export { Section, Container } from './ui/Section';
export type { SectionBackground, ContainerSize } from './ui/Section';
export type { ContainerSize, SectionBackground } from './ui/Section';
export { Container, Section } from './ui/Section';
+1 -1
View File
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/nextjs-vite';
import { Section, Container } from './Section';
import { Container, Section } from './Section';
const meta: Meta<typeof Section> = {
title: 'Shared/Section',
+3 -4
View File
@@ -1,6 +1,5 @@
import { describe, it, expect } from 'vitest';
import { render, screen } from '@testing-library/react';
import { Section, Container } from './Section';
import { Container, Section } from './Section';
describe('Section', () => {
describe('rendering', () => {
@@ -36,13 +35,13 @@ describe('Section', () => {
describe('bordered', () => {
it('no border classes by default', () => {
const { container } = render(<Section>x</Section>);
const el = container.querySelector('section')!;
const el = container.querySelector('section') as HTMLElement;
expect(el).not.toHaveClass('brutal-border-top');
expect(el).not.toHaveClass('brutal-border-bottom');
});
it('adds top and bottom borders when bordered=true', () => {
const { container } = render(<Section bordered>x</Section>);
const el = container.querySelector('section')!;
const el = container.querySelector('section') as HTMLElement;
expect(el).toHaveClass('brutal-border-top');
expect(el).toHaveClass('brutal-border-bottom');
});