fix: solve linting, formatting and ci/cd errors

This commit is contained in:
Igor Klepacki 2025-08-04 15:48:18 +02:00
parent 7fccba7fec
commit f496c48ad6
5 changed files with 36 additions and 28 deletions

View file

@ -1 +1 @@
v20.11.1 v24.3.0

View file

@ -39,7 +39,7 @@ With this template you will get all the boilerplate features included:
* [GitHub Actions](https://github.com/features/actions) - Pre-configured workflows including bundle size and performance tracking * [GitHub Actions](https://github.com/features/actions) - Pre-configured workflows including bundle size and performance tracking
* Perfect Lighthouse score - Optimized performance metrics * Perfect Lighthouse score - Optimized performance metrics
* [Bundle analyzer](https://www.npmjs.com/package/@next/bundle-analyzer) - Monitor and manage bundle size during development * [Bundle analyzer](https://www.npmjs.com/package/@next/bundle-analyzer) - Monitor and manage bundle size during development
* Testing suite - [Jest](https://jestjs.io/), [React Testing Library](https://testing-library.com/react), and [Playwright](https://playwright.dev/) for comprehensive testing * Testing suite - [Vitest](https://vitest.dev), [React Testing Library](https://testing-library.com/react), and [Playwright](https://playwright.dev/) for comprehensive testing
* [Storybook](https://storybook.js.org/) - Component development and documentation * [Storybook](https://storybook.js.org/) - Component development and documentation
* Advanced testing - Smoke and acceptance testing capabilities * Advanced testing - Smoke and acceptance testing capabilities
* [Conventional commits](https://www.conventionalcommits.org/) - Standardized commit history management * [Conventional commits](https://www.conventionalcommits.org/) - Standardized commit history management

View file

@ -1,24 +1,32 @@
import { describe, it, expect } from 'vitest' import { render, screen } from "@testing-library/react"
import { render, screen } from '@testing-library/react' import { describe, expect, it } from "vitest"
import { Button } from './Button' import { Button } from "./Button"
describe('Button', () => { describe("Button", () => {
it('renders with children', () => { it("renders with children", () => {
render(<Button href="/test">Click me</Button>) render(<Button href="/test">Click me</Button>)
expect(screen.getByText('Click me')).toBeInTheDocument() expect(screen.getByText("Click me")).toBeInTheDocument()
}) })
it('applies correct intent classes', () => { it("applies correct intent classes", () => {
const { container } = render(<Button href="/test" intent="secondary">Secondary</Button>) const { container } = render(
const link = container.querySelector('a') <Button href="/test" intent="secondary">
expect(link).toHaveClass('bg-transparent') Secondary
expect(link).toHaveClass('text-blue-400') </Button>
)
const link = container.querySelector("a")
expect(link).toHaveClass("bg-transparent")
expect(link).toHaveClass("text-blue-400")
}) })
it('applies correct size classes', () => { it("applies correct size classes", () => {
const { container } = render(<Button href="/test" size="sm">Small</Button>) const { container } = render(
const link = container.querySelector('a') <Button href="/test" size="sm">
expect(link).toHaveClass('text-sm') Small
expect(link).toHaveClass('min-w-20') </Button>
)
const link = container.querySelector("a")
expect(link).toHaveClass("text-sm")
expect(link).toHaveClass("min-w-20")
}) })
}) })

View file

@ -1,14 +1,14 @@
import { defineConfig } from 'vitest/config' import { defineConfig } from "vitest/config"
import react from '@vitejs/plugin-react' import react from "@vitejs/plugin-react"
import tsconfigPaths from 'vite-tsconfig-paths' import tsconfigPaths from "vite-tsconfig-paths"
export default defineConfig({ export default defineConfig({
plugins: [tsconfigPaths(), react()], plugins: [tsconfigPaths(), react()],
test: { test: {
environment: 'jsdom', environment: "jsdom",
setupFiles: './vitest.setup.ts', setupFiles: "./vitest.setup.ts",
globals: true, globals: true,
testMatch: ['**/*.test.{ts,tsx}', '**/*.spec.{ts,tsx}'], include: ["**/*.test.{ts,tsx}", "**/*.spec.{ts,tsx}"],
exclude: ['**/node_modules/**', '**/dist/**', '**/e2e/**', '.next/**'], exclude: ["**/node_modules/**", "**/dist/**", "**/e2e/**", ".next/**"],
}, },
}) })

View file

@ -1 +1 @@
import '@testing-library/jest-dom' import "@testing-library/jest-dom"