Disable show picked toggle when all items picked

This commit is contained in:
beatz174-bit committed 2025-11-23 14:52:18 +10:00
1 parent 6d024b2d25
commit 5262c6cdac
2 files changed
+39

No files matched your search

+27
View File
@@ -180,4 +180,31 @@ describe('ActivePickListScreen product search', () => {
await user.click(togglePicked);
expect(screen.getByText('Cola')).toBeVisible();
});
it('disables show picked toggle when all items are picked', async () => {
pickItemsMock.mockReturnValue([
{
id: 'item-1',
pick_list_id: 'list-1',
product_id: 'prod-1',
quantity: 1,
is_carton: false,
status: 'picked',
created_at: 0,
updated_at: 0,
},
]);
render(
<MemoryRouter initialEntries={['/pick-lists/1']}>
<Routes>
<Route path="/pick-lists/:id" element={<ActivePickListScreen />} />
</Routes>
</MemoryRouter>,
);
const togglePicked = screen.getByLabelText(/show picked/i);
expect(togglePicked).toBeDisabled();
expect(togglePicked).toBeChecked();
});
});