Correction affichage edition

Signed-off-by: Gato <cedric@goutailler-olivier.fr>
This commit is contained in:
2026-05-28 18:19:11 +02:00
parent e68232de21
commit 36cebe5144
4 changed files with 71 additions and 4 deletions
@@ -519,6 +519,32 @@ describe('IssueDetail — existing issue', () => {
});
});
describe('description edit flow', () => {
it('startEditDescription sets editingDescription to true and stores original text', () => {
(component as any).issue.description = 'original';
(component as any).startEditDescription();
expect((component as any).editingDescription).toBe(true);
expect((component as any)._descriptionBeforeEdit).toBe('original');
});
it('saveDescription exits edit mode and persists the description', async () => {
(component as any).issue.description = 'updated';
(component as any).editingDescription = true;
await (component as any).saveDescription();
expect((component as any).editingDescription).toBe(false);
expect(store.getById(1)?.description).toBe('updated');
});
it('cancelEditDescription restores the original description and exits edit mode', () => {
(component as any).issue.description = 'original';
(component as any).startEditDescription();
(component as any).issue.description = 'changed mid-edit';
(component as any).cancelEditDescription();
expect((component as any).issue.description).toBe('original');
expect((component as any).editingDescription).toBe(false);
});
});
describe('onDescriptionPaste', () => {
afterEach(() => vi.unstubAllGlobals());