Choose any allowed status in the table, set the cover on create

- the status cell offers every transition the entry allows, scheduling
  asks for the date right there
- POST /api/v1/posts takes cover_media_id, no second call needed
- the row grid follows its content so long type names stop overlapping
This commit is contained in:
Matthias G
2026-08-01 15:34:13 +02:00
parent 35a572c037
commit f8bc2d6108
8 changed files with 137 additions and 52 deletions
+24 -7
View File
@@ -10,7 +10,7 @@ vi.mock('~/lib/entry-actions', () => ({
archiveEntry: vi.fn(),
publishEntry: vi.fn(),
resumeEntry: vi.fn(),
unscheduleEntry: vi.fn(),
scheduleEntry: vi.fn(),
}))
const { EntryStatusControl } = await import('~/components/admin/EntryStatusControl')
@@ -20,14 +20,31 @@ function render(status: PostStatus): string {
}
describe('EntryStatusControl', () => {
it('bietet zu jedem Status den passenden Schritt an', () => {
expect(render('draft')).toContain('actions.publish')
expect(render('scheduled')).toContain('actions.unschedule')
expect(render('published')).toContain('actions.archive')
expect(render('archived')).toContain('actions.resume')
it('stellt jedem Status seine erlaubten Ziele zur Wahl', () => {
const draft = render('draft')
expect(draft).toContain('move.scheduled')
expect(draft).toContain('move.published')
expect(draft).toContain('move.archived')
expect(draft).not.toContain('move.draft')
})
it('zeigt den Status immer als Marke', () => {
it('lässt Veröffentlichtes nur zurückziehen', () => {
const published = render('published')
expect(published).toContain('move.archived')
expect(published).not.toContain('move.published')
expect(published).not.toContain('move.scheduled')
})
it('führt Zurückgezogenes zurück in den Entwurf', () => {
const archived = render('archived')
expect(archived).toContain('move.draft')
expect(archived).not.toContain('move.archived')
})
it('zeigt den Status immer an', () => {
expect(render('draft')).toContain('status.draft')
expect(render('published')).toContain('status.published')
})