test(geschichten/page): add failing tests for gated Veröffentlicht heading
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -392,4 +392,20 @@ describe('geschichten page — Entwürfe section', () => {
|
|||||||
const badge = document.querySelector('[data-testid="draft-badge"]');
|
const badge = document.querySelector('[data-testid="draft-badge"]');
|
||||||
expect(badge).not.toBeNull();
|
expect(badge).not.toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('Veröffentlicht heading is present when the Entwürfe section is visible', async () => {
|
||||||
|
render(Page, { data: makeData({ drafts: [draft()] as PageData['geschichten'] }) });
|
||||||
|
const heading = Array.from(document.querySelectorAll('h2')).find(
|
||||||
|
(h) => h.textContent?.includes('Veröffentlicht') || h.textContent?.includes('Published')
|
||||||
|
);
|
||||||
|
expect(heading).not.toBeUndefined();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Veröffentlicht heading is absent when there are no drafts', async () => {
|
||||||
|
render(Page, { data: makeData({ drafts: [] }) });
|
||||||
|
const heading = Array.from(document.querySelectorAll('h2')).find(
|
||||||
|
(h) => h.textContent?.includes('Veröffentlicht') || h.textContent?.includes('Published')
|
||||||
|
);
|
||||||
|
expect(heading).toBeUndefined();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user