test(editor): Cover failed/partial publish card states (no-changelog)

This commit is contained in:
Michael Siega 2026-07-13 11:29:20 +02:00
parent 189c13ffef
commit e04da39100

View File

@ -1441,7 +1441,9 @@ describe('WorkflowCard', () => {
const renderCard = (overrides: Partial<WorkflowResource> = {}) =>
renderComponent({ props: { data: createWorkflow(overrides) } });
it('shows an amber "Partial publish" indicator with a tooltip when publicationStatus is partial', async () => {
// The tooltip content is teleported and only mounted on hover with a positioned popper,
// which the jsdom harness can't render cleanly, so this asserts the visible indicator only.
it('shows an amber "Partial publish" indicator when publicationStatus is partial', async () => {
const { getByTestId, getByText } = renderCard({
publicationStatus: 'partial',
activeVersionId: 'v1',
@ -1455,6 +1457,24 @@ describe('WorkflowCard', () => {
expect(getByText('Failed publish')).toBeVisible();
});
it('shows the "Failed publish" indicator for a fully-failed publish with no active version', async () => {
const { getByTestId, getByText } = renderCard({
publicationStatus: 'failed',
activeVersionId: null,
});
expect(getByTestId('workflow-card-publish-indicator')).toBeVisible();
expect(getByText('Failed publish')).toBeVisible();
});
it('shows the "Partial publish" indicator for a partial publish with no active version', async () => {
const { getByTestId, getByText } = renderCard({
publicationStatus: 'partial',
activeVersionId: null,
});
expect(getByTestId('workflow-card-publish-indicator')).toBeVisible();
expect(getByText('Partial publish')).toBeVisible();
});
it('falls back to the legacy "Published" indicator when publicationStatus is absent', async () => {
const { getByText } = renderCard({ activeVersionId: 'v1' });
expect(getByText('Published')).toBeVisible();