Skip to content

Commit

Permalink
Attempt at improving balloon randomly failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
martinboulais committed Feb 21, 2025
1 parent 5d9f1bf commit 2a38cbd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 10 additions & 4 deletions test/public/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ const getPopoverContent = (popoverTrigger) => {
}

const popover = document.querySelector(`.popover[data-popover-key="${key}"]`);
return popover.innerHTML;
return popover.innerText;
});
};

Expand Down Expand Up @@ -558,11 +558,17 @@ module.exports.getPopoverInnerText = getPopoverInnerText;
*/
module.exports.checkColumnBalloon = async (page, rowIndex, columnIndex) => {
const popoverTrigger = await page.waitForSelector(`tbody tr:nth-of-type(${rowIndex}) td:nth-of-type(${columnIndex}) .popover-trigger`);
const triggerContent = await popoverTrigger.evaluate((element) => element.querySelector('.w-wrapped').innerHTML);
const triggerContent = await popoverTrigger.evaluate((element) => element.querySelector('.w-wrapped').innerText);

const actualContent = await getPopoverContent(popoverTrigger);
await page.hover(`tbody tr:nth-of-type(${rowIndex}) td:nth-of-type(${columnIndex}) .popover-trigger`);
const popoverSelector = await this.getPopoverSelector(popoverTrigger);

expect(triggerContent).to.be.equal(actualContent);
await this.expectInnerTextTo(
page,
popoverSelector,
// Newlines may be inconsistent between balloon and original data
(popoverContent) => popoverContent.replaceAll('\n', '') === triggerContent.replaceAll('\n', ''),
);
};

/**
Expand Down
2 changes: 0 additions & 2 deletions test/public/runs/overview.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,6 @@ module.exports = () => {
it('Should have balloon on detector, tags and eor column', async () => {
await goToPage(page, 'run-overview');

await pressElement(page, '#openFilterToggle');

// Run 106 has detectors and tags that overflow
await fillInput(page, filterPanelRunNumbersInputSelector, '106', ['change']);
await waitForTableLength(page, 1);
Expand Down

0 comments on commit 2a38cbd

Please sign in to comment.