KAN-73: document and validate MCP ticket description format
This commit is contained in:
@@ -3,6 +3,7 @@ import TicketDescriptionEditor from '../../resources/js/components/tickets/Ticke
|
||||
import TicketDescription from '../../resources/js/components/tickets/TicketDescription.vue';
|
||||
import { createLocalization } from '../../resources/js/lib/localization';
|
||||
import '../../resources/css/app.css';
|
||||
import descriptionFormat from '../../resources/js/lib/ticket-description-format.json';
|
||||
|
||||
const original = 'First line\nSecond line\n\n**Existing bold**';
|
||||
const state = reactive({
|
||||
@@ -199,6 +200,33 @@ try {
|
||||
state.value =
|
||||
'# Plan\n\nUse **bold** and *italic* formatting, lists and [links](https://example.test).\n\n- Create ticket\n- Save description\n\n> Keep existing descriptions readable.';
|
||||
await tick();
|
||||
state.value = descriptionFormat.example;
|
||||
await tick();
|
||||
assert(
|
||||
document.querySelector('#description h2')?.textContent === 'Goal',
|
||||
'MCP example opens formatted in WYSIWYG',
|
||||
);
|
||||
assert(
|
||||
document.querySelector('#description strong')?.textContent ===
|
||||
'context',
|
||||
'MCP emphasis is formatted',
|
||||
);
|
||||
assert(
|
||||
document.querySelectorAll('#description li').length === 2,
|
||||
'MCP ordinary lists render',
|
||||
);
|
||||
assert(
|
||||
!document.querySelector('textarea#description'),
|
||||
'MCP example avoids source fallback',
|
||||
);
|
||||
state.value = '## Legacy\n\n- [ ] Criterion';
|
||||
await tick();
|
||||
assert(
|
||||
document.querySelector('textarea#description')?.value === state.value,
|
||||
'Legacy task checkboxes retain original source',
|
||||
);
|
||||
state.value = descriptionFormat.example;
|
||||
await tick();
|
||||
state.result =
|
||||
'Browser checks passed: formatting, undo/redo, source round-trip, links, errors, disabled state, reset, clearing and legacy content.';
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user