fix: solve linting, formatting and ci/cd errors

This commit is contained in:
Igor Klepacki 2025-08-04 15:48:18 +02:00
parent 22e3c1dc11
commit e4b8712d01
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
* Perfect Lighthouse score - Optimized performance metrics
* [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
* Advanced testing - Smoke and acceptance testing capabilities
* [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 { Button } from './Button'
import { render, screen } from "@testing-library/react"
import { describe, expect, it } from "vitest"
import { Button } from "./Button"
describe('Button', () => {
it('renders with children', () => {
describe("Button", () => {
it("renders with children", () => {
render(<Button href="/test">Click me</Button>)
expect(screen.getByText('Click me')).toBeInTheDocument()
expect(screen.getByText("Click me")).toBeInTheDocument()
})
it('applies correct intent classes', () => {
const { container } = render(<Button href="/test" intent="secondary">Secondary</Button>)
const link = container.querySelector('a')
expect(link).toHaveClass('bg-transparent')
expect(link).toHaveClass('text-blue-400')
it("applies correct intent classes", () => {
const { container } = render(
<Button href="/test" intent="secondary">
Secondary
</Button>
)
const link = container.querySelector("a")
expect(link).toHaveClass("bg-transparent")
expect(link).toHaveClass("text-blue-400")
})
it('applies correct size classes', () => {
const { container } = render(<Button href="/test" size="sm">Small</Button>)
const link = container.querySelector('a')
expect(link).toHaveClass('text-sm')
expect(link).toHaveClass('min-w-20')
it("applies correct size classes", () => {
const { container } = render(
<Button href="/test" size="sm">
Small
</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 react from '@vitejs/plugin-react'
import tsconfigPaths from 'vite-tsconfig-paths'
import { defineConfig } from "vitest/config"
import react from "@vitejs/plugin-react"
import tsconfigPaths from "vite-tsconfig-paths"
export default defineConfig({
plugins: [tsconfigPaths(), react()],
test: {
environment: 'jsdom',
setupFiles: './vitest.setup.ts',
environment: "jsdom",
setupFiles: "./vitest.setup.ts",
globals: true,
testMatch: ['**/*.test.{ts,tsx}', '**/*.spec.{ts,tsx}'],
exclude: ['**/node_modules/**', '**/dist/**', '**/e2e/**', '.next/**'],
include: ["**/*.test.{ts,tsx}", "**/*.spec.{ts,tsx}"],
exclude: ["**/node_modules/**", "**/dist/**", "**/e2e/**", ".next/**"],
},
})
})

View file

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