Skip to content

Commit

Permalink
fix regions failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
sumn2u committed Jul 23, 2024
1 parent fffcc10 commit 633618c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions client/src/RegionLabel/RegionLabel.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ const renderComponent = (props) => {
)
}

// Mock the useTheme hook
jest.mock('../ThemeContext', () => ({
useTheme: () => ({
theme: 'light', // Provide mock theme
toggleTheme: jest.fn(), // Mock function
}),
}));

// Mock the useTranslation hook
jest.mock("react-i18next", () => ({
useTranslation: () => ({
Expand Down
8 changes: 8 additions & 0 deletions client/src/RegionTags/RegionTags.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ jest.mock("react-i18next", () => ({
}),
}))

// Mock the useTheme hook
jest.mock('../ThemeContext', () => ({
useTheme: () => ({
theme: 'light', // Provide mock theme
toggleTheme: jest.fn(), // Mock function
}),
}));

describe("RegionTags component", () => {
it("renders correctly for different region conditions", () => {
const regions = [
Expand Down

0 comments on commit 633618c

Please sign in to comment.