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

Testing good #340

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
21 changes: 8 additions & 13 deletions package-lock.json

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

8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"build": "vite build",
"lint": "eslint .",
"preview": "vite preview",
"test": "vitest"
"test": "vitest",
"format": "prettier --write ."
},
"dependencies": {
"@fortawesome/free-brands-svg-icons": "^6.6.0",
Expand All @@ -18,7 +19,6 @@
"axios": "^1.7.7",
"chart.js": "^4.4.4",
"express": "^4.21.1",
"icons": "^1.0.0",
"react": "^18.3.1",
"react-chartjs-2": "^5.2.0",
"react-dom": "^18.3.1",
Expand All @@ -33,16 +33,14 @@
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.0.1",
"@testing-library/user-event": "^14.5.2",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
"@vitest/browser": "^2.0.5",
"eslint": "^9.9.0",
"eslint-plugin-react": "^7.35.0",
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
"eslint-plugin-react-refresh": "^0.4.9",
"globals": "^15.9.0",
"jsdom": "^25.0.0",
"jsdom": "^25.0.1",
"nodemon": "^3.1.7",
"vite": "^5.4.1",
"vitest": "^2.0.5"
Expand Down
20 changes: 20 additions & 0 deletions src/components/priceRange/PriceRangeFilter.test.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import PriceRangeFilter from "./PriceRangeFilter";
import { render, screen } from "@testing-library/react";


test("renders PriceRangeFilter and checks for specific text", () => {
// Provide mock histogram data for rendering
const mockHistogramData = [
{ from: 10, to: 50, count: 5 },
{ from: 51, to: 100, count: 10 },
];

// Render the component
render(<PriceRangeFilter histogramData={mockHistogramData} />);

// Check if the specific text is present in the rendered output
const textElement = screen.getByText(/Nightly prices including fees and taxes/i);

// Assert that the text element is in the document
expect(textElement).toBeInTheDocument();
});
Loading