mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-04 18:04:18 +00:00
fix(mobile): group checklist progress and filtering
Move packed-item visibility into the packing actions menu. Share an accessible progress display with To-Do and keep count badges only on filters with matching tasks.
This commit is contained in:
@@ -298,18 +298,23 @@ describe('MPackingListTab', () => {
|
||||
expect(screen.getByText('packing.personalEmptyHint')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('FE-MOB-PACKTAB-019: the visible filter hides packed items and restores them on a second tap', async () => {
|
||||
it('FE-MOB-PACKTAB-019: the actions menu hides packed items and offers to show them again', async () => {
|
||||
await setup()
|
||||
expect(screen.queryByRole('button', { name: 'packing.hideDone' })).not.toBeInTheDocument()
|
||||
openActions()
|
||||
fireEvent.click(screen.getByRole('button', { name: 'packing.hideDone' }))
|
||||
await waitFor(() => expect(screen.queryByRole('dialog', { name: 'packing.actions' })).not.toBeInTheDocument())
|
||||
expect(screen.queryByText('Passport')).toBeNull()
|
||||
expect(screen.getByText('Visa')).toBeInTheDocument()
|
||||
|
||||
fireEvent.click(screen.getByRole('button', { name: 'packing.hideDone' }))
|
||||
openActions()
|
||||
fireEvent.click(screen.getByRole('button', { name: 'packing.showDone' }))
|
||||
expect(screen.getByText('Passport')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('FE-MOB-PACKTAB-020: hiding everything shows the filtered-empty hint', async () => {
|
||||
await setup({ items: [packItem({ id: 1, name: 'Visa', checked: 1 })] })
|
||||
openActions()
|
||||
fireEvent.click(screen.getByRole('button', { name: 'packing.hideDone' }))
|
||||
expect(screen.getByText('packing.emptyFiltered')).toBeInTheDocument()
|
||||
fireEvent.click(screen.getByRole('button', { name: 'packing.filterAll' }))
|
||||
|
||||
@@ -123,10 +123,10 @@ describe('MTodoListTab', () => {
|
||||
todo({ id: 4, name: 'Done', checked: 1 }),
|
||||
])
|
||||
|
||||
expect(screen.getByRole('button', { name: 'todo.filter.all3' })).toBeInTheDocument()
|
||||
expect(screen.getByRole('button', { name: 'todo.filter.myShort1' })).toBeInTheDocument()
|
||||
expect(screen.getByRole('button', { name: 'todo.filter.overdue1' })).toBeInTheDocument()
|
||||
expect(screen.getByRole('button', { name: 'todo.filter.done1' })).toBeInTheDocument()
|
||||
expect(screen.getByRole('button', { name: 'todo.filter.all 3' })).toBeInTheDocument()
|
||||
expect(screen.getByRole('button', { name: 'todo.filter.myShort 1' })).toBeInTheDocument()
|
||||
expect(screen.getByRole('button', { name: 'todo.filter.overdue 1' })).toBeInTheDocument()
|
||||
expect(screen.getByRole('button', { name: 'todo.filter.done 1' })).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('FE-MOB-TODO-005: defaults to the open items and hides done ones', () => {
|
||||
@@ -161,7 +161,7 @@ describe('MTodoListTab', () => {
|
||||
seedStore(useAuthStore, { user: null })
|
||||
setup([todo({ id: 1, name: 'Mine', assigned_user_id: ME })])
|
||||
|
||||
expect(screen.getByRole('button', { name: 'todo.filter.myShort0' })).toBeInTheDocument()
|
||||
expect(screen.getByRole('button', { name: 'todo.filter.myShort' })).not.toHaveTextContent('0')
|
||||
|
||||
fireEvent.click(screen.getByRole('button', { name: /todo.filter.my/ }))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user