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