Make conversation queues mutually exclusive
This commit is contained in:
1 parent
3bb1dda6bb
commit
2447563c60
20 files changed
+386
-220
No files matched your search
@@ -33,20 +33,22 @@ describe('route-friendly filters', () => {
|
||||
server.use(http.get('/api/conversations', () => HttpResponse.json([])));
|
||||
const user = userEvent.setup();
|
||||
renderRoute(
|
||||
'/conversations?q=alice&filter=received-images&showSellers=true&sort=oldest-unanswered',
|
||||
'/conversations?q=alice&filter=awaiting-reply&unread=true&manual=true&images=true&sort=oldest-unanswered',
|
||||
<ConversationRoute />,
|
||||
);
|
||||
const search = await screen.findByRole('searchbox', { name: 'Search conversations' });
|
||||
expect(search).toHaveValue('alice');
|
||||
expect(screen.getByRole('button', { name: /^Images/ })).toHaveAttribute('aria-pressed', 'true');
|
||||
expect(screen.getByRole('button', { name: /^Waiting/ })).toHaveAttribute('aria-pressed', 'true');
|
||||
expect(screen.getByRole('combobox', { name: 'Sort' })).toHaveValue('oldest-unanswered');
|
||||
expect(screen.getByRole('checkbox', { name: 'Show sellers' })).toBeChecked();
|
||||
expect(screen.getByRole('checkbox', { name: 'Unread only' })).toBeChecked();
|
||||
expect(screen.getByRole('checkbox', { name: 'Manual only' })).toBeChecked();
|
||||
expect(screen.getByRole('checkbox', { name: 'Has images' })).toBeChecked();
|
||||
await user.clear(search);
|
||||
await user.type(search, 'bob');
|
||||
expect(screen.getByLabelText('Current URL')).toHaveTextContent('q=bob');
|
||||
|
||||
await user.click(screen.getByRole('button', { name: /^Needs reply/ }));
|
||||
expect(screen.getByLabelText('Current URL')).toHaveTextContent('filter=needs-reply');
|
||||
await user.click(screen.getByRole('button', { name: /^Needs attention/ }));
|
||||
expect(screen.getByLabelText('Current URL')).not.toHaveTextContent('filter=');
|
||||
});
|
||||
|
||||
it('hydrates and writes media filters', async () => {
|
||||
|
||||
Reference in new issue
Block a user