Skip to content

Commit

Permalink
Add Test Coverage and UI
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasCode92 authored Dec 24, 2024
1 parent 6ea8062 commit 7eb338c
Show file tree
Hide file tree
Showing 6 changed files with 274 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# Test Results
tests/coverage
tests/reports

node_modules
dist
dist-ssr
Expand Down
249 changes: 249 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"dev": "vite",
"build": "tsc -b && vite build",
"test": "vitest",
"test:ui": "vitest --ui --coverage.enabled=true",
"coverage": "vitest run --coverage",
"format": "prettier --write .",
"lint": "eslint .",
"preview": "vite preview",
Expand All @@ -29,7 +31,9 @@
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.4",
"@vitest/coverage-v8": "^2.1.8",
"@vitest/eslint-plugin": "^1.1.18",
"@vitest/ui": "^2.1.8",
"autoprefixer": "^10.4.20",
"eslint": "^9.17.0",
"eslint-config-prettier": "^9.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/components/UI/FormInput.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test("should render with the correct label", () => {
});

test("should apply shrink classes when input has value", () => {
render(<FormInput label="Username" value="test" />);
render(<FormInput label="Username" value="test" onChange={vi.fn()} />);
const labelElement = screen.getByText("Username");
expect(labelElement).toHaveClass("-top-5 text-xs text-black");
});
Expand Down
Loading

0 comments on commit 7eb338c

Please sign in to comment.