mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-23 05:21:15 +00:00
feat(dialogs): Vacay, Collections, Atlas and Journey in the new dialog look
Every popup of the four pages moves to the shared dialog frame the trip uses: head band with its icon, the scrolling body, the footer with its actions, and ConfirmDialog for the questions. - Vacay: settings, removing a year (now says so when it fails), the fusion request, inviting a person, a person's colour and sharing the calendar. - Collections: new and edited lists, adding a place, importing a file and a trip's places, sharing, labels and assigning them, copying to a trip, moving or duplicating, saving a trip's places and deleting a list. The stylesheet of the old import view goes. - Atlas: the country popup with the flag in its head, its choices as rows and the wishlist step; Dawarich's Atlas dialog and its accept dialog on the desktop. - Journey: creating a journey, its settings, linking a trip, inviting a contributor, the entry editor (discarding asks in a dialog) and the photo provider picker; the entry card's menu is the shared one. The phone keeps its own sheets: where a dialog is shared with it (Dawarich, the contributor invite, the provider picker) only the desktop frame changes.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import React from 'react'
|
||||
import type { Mock } from 'vitest'
|
||||
import { http, HttpResponse } from 'msw'
|
||||
import { render, screen, fireEvent, waitFor } from '../../../tests/helpers/render'
|
||||
import { render, screen, fireEvent, waitFor, within } from '../../../tests/helpers/render'
|
||||
import { server } from '../../../tests/helpers/msw/server'
|
||||
import type { Category } from '@trek/shared'
|
||||
import { useTranslation } from '../../i18n/TranslationContext'
|
||||
@@ -68,6 +68,11 @@ function typeName(value: string): void {
|
||||
fireEvent.change(screen.getByPlaceholderText('Name'), { target: { value } })
|
||||
}
|
||||
|
||||
/** The results panel's own close button; the dialog's head band has one of the same name. */
|
||||
function dismissResultsButton(): HTMLElement {
|
||||
return within(screen.getByRole('group', { name: 'Search' })).getByRole('button', { name: 'Close' })
|
||||
}
|
||||
|
||||
describe('AddPlaceToCollectionModal', () => {
|
||||
beforeEach(() => {
|
||||
addToast = vi.fn<AddToast>(() => 0)
|
||||
@@ -151,7 +156,7 @@ describe('AddPlaceToCollectionModal', () => {
|
||||
fireEvent.click(screen.getByRole('button', { name: /Search/ }))
|
||||
await screen.findByText('Kissa Sakaiki')
|
||||
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Close' }))
|
||||
fireEvent.click(dismissResultsButton())
|
||||
expect(screen.queryByText('Kissa Sakaiki')).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
@@ -182,7 +187,7 @@ describe('AddPlaceToCollectionModal', () => {
|
||||
fireEvent.click(screen.getByRole('button', { name: /Search/ }))
|
||||
await screen.findByText('No places found')
|
||||
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Close' }))
|
||||
fireEvent.click(dismissResultsButton())
|
||||
expect(screen.queryByText('No places found')).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user