fix: Prevent overflow when rendering expression hints (#6214)

* fix: Prevent whitespace overflow

* fix: show overflow ellipsis

* chore: add comment

* chore: clean up other approach

* test: update tests, fix test

* test: uncomment test
This commit is contained in:
Mutasem Aldmour
2023-05-10 10:32:09 +02:00
committed by GitHub
parent 9e7b9fb443
commit c7177719e5
4 changed files with 73 additions and 14 deletions

View File

@@ -157,6 +157,19 @@ export class NDV extends BasePage {
this.getters.resourceLocatorModeSelector(paramName).click();
this.getters.resourceLocatorModeSelector(paramName).find('li').last().click();
this.getters.resourceLocatorInput(paramName).type(value);
}
},
validateExpressionPreview: (paramName: string, value: string) => {
this.getters.parameterExpressionPreview(paramName).find('span').should('include.html', asEncodedHTML(value));
},
};
}
function asEncodedHTML(str: string): string {
return String(str)
.replace(/&/g, '&')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/ /g, '&nbsp;');
}