-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
8 changed files
with
83 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
recommender-front/src/components/header/AccessibilityComponent.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from 'react'; | ||
import MenuItem from '@mui/material/MenuItem'; | ||
import FormControl from '@mui/material/FormControl'; | ||
import Select from '@mui/material/Select'; | ||
import Typography from '@mui/material/Typography'; | ||
|
||
function AccessibilityComponent({ accessibility, handleChange }) { | ||
return ( | ||
<FormControl> | ||
<Select displayEmpty value={accessibility} onChange={handleChange} data-testid="accessibility-select"> | ||
<MenuItem value=""> | ||
<Typography variant="h2">All attractions</Typography> | ||
</MenuItem> | ||
<MenuItem value="rollator"> | ||
<Typography variant="h2">Rollator accessible</Typography> | ||
</MenuItem> | ||
<MenuItem value="stroller"> | ||
<Typography variant="h2">Stroller accessible</Typography> | ||
</MenuItem> | ||
<MenuItem value="wheelchair"> | ||
<Typography variant="h2">Wheelchair accessible</Typography> | ||
</MenuItem> | ||
<MenuItem value="reduced_mobility"> | ||
<Typography variant="h2">Reduced mobility</Typography> | ||
</MenuItem> | ||
<MenuItem value="visually_impaired"> | ||
<Typography variant="h2">Visually impaired</Typography> | ||
</MenuItem> | ||
</Select> | ||
</FormControl> | ||
); | ||
} | ||
|
||
export default AccessibilityComponent; |
22 changes: 22 additions & 0 deletions
22
recommender-front/src/components/header/AccessibilityComponent.test.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
import AccessibilityComponent from './AccessibilityComponent'; | ||
|
||
jest.mock('react-leaflet', () => { | ||
const originalModule = jest.requireActual('react-leaflet'); | ||
return { | ||
...originalModule, | ||
MapContainer: originalModule.MapContainer, | ||
}; | ||
}); | ||
|
||
describe('AccessibilityComponent', () => { | ||
test('renders without crashing', () => { | ||
const mockProps = { | ||
accessibility: 'wheelchair', | ||
}; | ||
|
||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
render(<AccessibilityComponent {...mockProps} />); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 0 additions & 77 deletions
77
recommender-front/src/components/selector/AccessibilitySelector.jsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters