diff --git a/frontend/src/features/contact/components/MessagesTable.tsx b/frontend/src/features/contact/components/MessagesTable.tsx
index 6ebff43..6ee667e 100644
--- a/frontend/src/features/contact/components/MessagesTable.tsx
+++ b/frontend/src/features/contact/components/MessagesTable.tsx
@@ -52,13 +52,15 @@ export function MessagesTable({ items, onOpen }: Props) {
onOpen(m.id)}
+ className={`cursor-pointer hover:bg-muted/50 ${
m.status === 'spam'
? 'bg-destructive/5'
: m.status === 'new'
? 'font-semibold'
: ''
- }
+ }`}
>
|
{format.format(new Date(m.receivedAt))}
diff --git a/frontend/src/features/contact/pages/MessagesPage.test.tsx b/frontend/src/features/contact/pages/MessagesPage.test.tsx
index b637ec7..a3f7b4c 100644
--- a/frontend/src/features/contact/pages/MessagesPage.test.tsx
+++ b/frontend/src/features/contact/pages/MessagesPage.test.tsx
@@ -696,3 +696,13 @@ describe('Dashboard tile', () => {
expect(screen.queryByTestId('messages-tile')).not.toBeInTheDocument();
});
});
+
+describe('Clickable row', () => {
+ it('opens the message when any cell of the row is clicked', async () => {
+ await openPage();
+ const row = await screen.findByTestId(`contact-row-${MSG_READ}`);
+ await userEvent.click(within(row).getByText('Onderhoudspakket'));
+ expect(await screen.findByTestId('contact-message-dialog')).toBeInTheDocument();
+ expect(await screen.findByTestId('contact-message-body')).toHaveTextContent('Hallo');
+ });
+});
|