From acd2cbe239a70c6e4534defa0c580470b411a104 Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Fri, 23 Feb 2024 08:28:01 +0100 Subject: [PATCH] test: show documentation link --- test/spec/modeler/Linting.spec.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/spec/modeler/Linting.spec.js b/test/spec/modeler/Linting.spec.js index f2a14ed..9dfba67 100644 --- a/test/spec/modeler/Linting.spec.js +++ b/test/spec/modeler/Linting.spec.js @@ -175,13 +175,21 @@ describe('Linting', function() { container.innerHTML = ''; reports.map((report) => { - const { id, message, category, rule } = report; + const { id, message, category, rule, documentation } = report; if (category === 'rule-error') { return domify(`
Rule error: Rule <${ escapeHTML(rule) }> errored with the following message: ${ escapeHTML(message) }
`); } - const element = domify(`
${ id }: ${escapeHTML(message) }
`); + const element = domify(`
${ id }: ${escapeHTML(message) }
`); + + if (documentation.url) { + const documentationLink = domify(`ref`); + + documentationLink.addEventListener('click', e => e.stopPropagation()); + + element.appendChild(documentationLink); + } element.addEventListener('click', () => { linting.showError(report);