Skip to content

Commit

Permalink
test: show documentation link
Browse files Browse the repository at this point in the history
  • Loading branch information
nikku committed Feb 23, 2024
1 parent 52c3eff commit acd2cbe
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/spec/modeler/Linting.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(`<div class="errorItem">Rule error: Rule <${ escapeHTML(rule) }> errored with the following message: ${ escapeHTML(message) }</div>`);
}

const element = domify(`<div class="errorItem">${ id }: ${escapeHTML(message) }</div>`);
const element = domify(`<div class="errorItem">${ id }: ${escapeHTML(message) } </div>`);

if (documentation.url) {
const documentationLink = domify(`<a href="${ documentation.url }" rel="noopener" target="_blank">ref</a>`);

documentationLink.addEventListener('click', e => e.stopPropagation());

element.appendChild(documentationLink);
}

element.addEventListener('click', () => {
linting.showError(report);
Expand Down

0 comments on commit acd2cbe

Please sign in to comment.