feat(journey-editor): JourneyEditor frontend — issue #753 #792
@@ -85,7 +85,8 @@ describe('DocumentPickerDropdown — selection', () => {
|
||||
|
||||
await userEvent.fill(page.getByRole('combobox'), 'Brief');
|
||||
await waitForDebounce();
|
||||
await userEvent.click(page.getByRole('option', { name: /Brief von Eugenie/i }));
|
||||
// aria-disabled items are not "enabled" — userEvent refuses them; use force click
|
||||
await page.getByRole('option', { name: /Brief von Eugenie/i }).click({ force: true });
|
||||
|
||||
expect(onSelect).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@@ -25,6 +25,8 @@ describe('createBlockDragDrop — generic type guard', () => {
|
||||
it('TranscriptionBlockData caller still compiles — regression guard for existing transcription editor', () => {
|
||||
// If the generic constraint is wrong this line fails tsc --noEmit
|
||||
expectTypeOf(createBlockDragDrop<TranscriptionBlockData>).toBeFunction();
|
||||
// Runtime assertion so browser-mode doesn't report "no assertions"
|
||||
expect(typeof createBlockDragDrop).toBe('function');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ describe('JourneyAddBar — interlude flow', () => {
|
||||
|
||||
await userEvent.click(page.getByText('Zwischentext hinzufügen'));
|
||||
|
||||
const confirmBtn = page.getByRole('button', { name: 'Hinzufügen' });
|
||||
const confirmBtn = page.getByRole('button', { name: 'Hinzufügen', exact: true });
|
||||
await expect.element(confirmBtn).toHaveAttribute('aria-disabled', 'true');
|
||||
});
|
||||
|
||||
@@ -21,7 +21,7 @@ describe('JourneyAddBar — interlude flow', () => {
|
||||
await userEvent.click(page.getByText('Zwischentext hinzufügen'));
|
||||
await userEvent.fill(page.getByRole('textbox'), 'Eine schöne Reise');
|
||||
|
||||
const confirmBtn = page.getByRole('button', { name: 'Hinzufügen' });
|
||||
const confirmBtn = page.getByRole('button', { name: 'Hinzufügen', exact: true });
|
||||
await expect.element(confirmBtn).toHaveAttribute('aria-disabled', 'false');
|
||||
});
|
||||
|
||||
@@ -31,7 +31,7 @@ describe('JourneyAddBar — interlude flow', () => {
|
||||
|
||||
await userEvent.click(page.getByText('Zwischentext hinzufügen'));
|
||||
await userEvent.fill(page.getByRole('textbox'), 'Reise nach Wien');
|
||||
await userEvent.click(page.getByRole('button', { name: 'Hinzufügen' }));
|
||||
await userEvent.click(page.getByRole('button', { name: 'Hinzufügen', exact: true }));
|
||||
|
||||
expect(onAddInterlude).toHaveBeenCalledWith('Reise nach Wien');
|
||||
});
|
||||
|
||||
@@ -47,9 +47,8 @@ afterEach(() => {
|
||||
describe('JourneyEditor — empty state', () => {
|
||||
it('renders title input and intro textarea', async () => {
|
||||
render(JourneyEditor, defaultProps());
|
||||
await expect.element(page.getByRole('textbox', { name: /Titel/ })).not.toBeInTheDocument(); // input has no aria-label
|
||||
// title input has placeholder text
|
||||
await expect.element(page.getByPlaceholder(/Titel/)).toBeInTheDocument();
|
||||
await expect.element(page.getByPlaceholder(/Einleitung/)).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('publish button disabled when no items', async () => {
|
||||
@@ -80,6 +79,7 @@ describe('JourneyEditor — publish disabled when title empty', () => {
|
||||
JourneyEditor,
|
||||
defaultProps({
|
||||
geschichte: makeGeschichte({
|
||||
title: '',
|
||||
items: [{ id: 'i1', position: 0, document: docSummary('d1', 'Brief A') }]
|
||||
})
|
||||
})
|
||||
@@ -163,8 +163,8 @@ describe('JourneyEditor — add interlude', () => {
|
||||
render(JourneyEditor, defaultProps());
|
||||
|
||||
await userEvent.click(page.getByText('Zwischentext hinzufügen'));
|
||||
await userEvent.fill(page.getByRole('textbox'), 'Reise nach Wien');
|
||||
await userEvent.click(page.getByRole('button', { name: 'Hinzufügen' }));
|
||||
await userEvent.fill(page.getByPlaceholder('Zwischentext eingeben…'), 'Reise nach Wien');
|
||||
await userEvent.click(page.getByRole('button', { name: 'Hinzufügen', exact: true }));
|
||||
|
||||
expect(globalThis.fetch).toHaveBeenCalledWith(
|
||||
expect.stringContaining('/items'),
|
||||
@@ -203,8 +203,8 @@ describe('JourneyEditor — remove with rollback', () => {
|
||||
|
||||
// Add interlude (no unsaved warning should interfere)
|
||||
await userEvent.click(page.getByText('Zwischentext hinzufügen'));
|
||||
await userEvent.fill(page.getByRole('textbox'), 'Test');
|
||||
await userEvent.click(page.getByRole('button', { name: 'Hinzufügen' }));
|
||||
await userEvent.fill(page.getByPlaceholder('Zwischentext eingeben…'), 'Test');
|
||||
await userEvent.click(page.getByRole('button', { name: 'Hinzufügen', exact: true }));
|
||||
|
||||
// Saving (which requires non-empty title) — no unsaved warning dialog
|
||||
await expect.element(page.getByRole('dialog')).not.toBeInTheDocument();
|
||||
|
||||
Reference in New Issue
Block a user