Skip to content

Commit

Permalink
[Discover] Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jughosta committed Sep 12, 2024
1 parent 81bb762 commit 316c49d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ function getCellTextContent(cell: Element) {

// remove from the grid
dropBySelector(cellCloned, '.euiIcon');
dropBySelector(cellCloned, '[data-euiicon-type]');
dropBySelector(cellCloned, '.euiToken');
dropBySelector(cellCloned, 'svg');

Expand All @@ -110,7 +111,9 @@ function getCellTextContent(cell: Element) {
replaceWithSrcTextNode(cellCloned, 'img');
replaceWithSrcTextNode(cellCloned, 'audio');

return (cellCloned.textContent || '').trim();
const textContent = (cellCloned.textContent || '').trim();

return textContent.replaceAll('\n', '');
}

function replaceWithSrcTextNode(element: HTMLElement, tagName: 'img' | 'audio') {
Expand Down

0 comments on commit 316c49d

Please sign in to comment.