mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-28 23:50:08 +00:00
fix(tours): keep editor dropdowns inside the sidebar
This commit is contained in:
@@ -8,7 +8,7 @@ import type { TourPlannerController } from '../Tours/planner/useTourPlanner'
|
||||
import ToursSidebar from '../Tours/ToursSidebar'
|
||||
import type { Day } from '../../types'
|
||||
import CustomSelect from './CustomSelect'
|
||||
import { hikePlannerDefaults } from '../../../tests/helpers/tourPlannerStub'
|
||||
import { hikePlannerDefaults, mockTourEditorLayout } from '../../../tests/helpers/tourPlannerStub'
|
||||
|
||||
vi.mock('../../repo/tourRepo', () => ({ tourRepo: {} }))
|
||||
vi.mock('../../store/settingsStore', () => ({
|
||||
@@ -57,6 +57,7 @@ describe('CustomSelect consumer contracts', () => {
|
||||
expect(screen.getByLabelText('Maximum trail difficulty')).toBe(trigger)
|
||||
expect(trigger).toHaveAttribute('id', 'tour-planner-difficulty')
|
||||
expect(document.querySelectorAll('[id="tour-planner-difficulty"]')).toHaveLength(1)
|
||||
mockTourEditorLayout(trigger.parentElement ?? trigger)
|
||||
await user.click(trigger)
|
||||
const menu = within(document.getElementById(trigger.getAttribute('aria-controls')!)!)
|
||||
for (const difficulty of [1, 2, 3, 4, 5, 6]) {
|
||||
@@ -132,4 +133,4 @@ describe('CustomSelect consumer contracts', () => {
|
||||
await user.click(screen.getByRole('button', { name: /^Planned\s*1$/ }))
|
||||
expect(setFilter).toHaveBeenLastCalledWith('planned')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user