diff --git a/admin/src/tabs/HeldTab.test.tsx b/admin/src/tabs/HeldTab.test.tsx index 5abdc84..e1e8c3b 100644 --- a/admin/src/tabs/HeldTab.test.tsx +++ b/admin/src/tabs/HeldTab.test.tsx @@ -76,15 +76,21 @@ describe('held tab', () => { expect(await screen.findByText(/nothing is waiting/i)).toBeInTheDocument() }) - it('explains how messages get held when posting is not moderated', async () => { - await setup([], aList({ id: 1, post_policy: 'members' })) - expect(await screen.findByText(/set posting to moderated/i)).toBeInTheDocument() + it('explains both ways a message gets held, whatever the posting policy', async () => { + for (const post_policy of ['members', 'moderated'] as const) { + const { unmount } = await setup([], aList({ id: 1, post_policy })) + const hint = await screen.findByText(/messages are held when/i) + expect(hint).toHaveTextContent(/posting is set to moderated/i) + expect(hint).toHaveTextContent(/from header does not match the sender/i) + expect(hint).not.toHaveTextContent(/only/i) + unmount() + } }) - it('does not nag about the policy when the list is moderated', async () => { - await setup([]) - await screen.findByText(/nothing is waiting/i) - expect(screen.queryByText(/set posting to moderated/i)).not.toBeInTheDocument() + it('shows no hint when there are held messages', async () => { + await setup([held(1)]) + await screen.findByText('Subject 1') + expect(screen.queryByText(/messages are held when/i)).not.toBeInTheDocument() }) it('approves a message: it is sent and leaves the queue', async () => { diff --git a/admin/src/tabs/HeldTab.tsx b/admin/src/tabs/HeldTab.tsx index fa3c0e6..4b43188 100644 --- a/admin/src/tabs/HeldTab.tsx +++ b/admin/src/tabs/HeldTab.tsx @@ -51,9 +51,10 @@ export function HeldTab() { {held.data && items.length === 0 && (
Nothing is waiting for approval.
- {list.post_policy !== 'moderated' && ( -Messages are held only when you set Posting to moderated in Settings.
- )} ++ Messages are held when Posting is set to moderated in Settings, or when the From header does not match + the sender. +