Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Test Coverage and UI #28

Merged
merged 4 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading