Skip to content

Commit 49a2053

Browse files
author
GuustMetz
committed
test: fix last and final test
1 parent 1b02bd3 commit 49a2053

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

test/public/lhcFills/overview.test.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,19 @@ module.exports = () => {
163163
});
164164

165165
it('fill dropdown menu should be correct', async() => {
166-
// activate the popover
167-
await pressElement(page, `#row6-fillNumber-text > div:nth-child(1) > div:nth-child(2)`)
168-
await page.waitForSelector(`body > div:nth-child(3) > div:nth-child(1)`);
169-
await expectInnerText(page, `#copy-6 > div:nth-child(1)`, 'Copy Fill Number')
166+
const popoverTrigger = '#row6-fillNumber-text > div:nth-child(1) > div:nth-child(2)';
170167

171-
await expectLink(page, 'body > div:nth-child(4) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > a:nth-child(3)', {
168+
await pressElement(page, popoverTrigger);
169+
await expectInnerText(page, '#copy-6 > div:nth-child(1)', 'Copy Fill Number');
170+
171+
const popoverSelector = await getPopoverSelector(await page.waitForSelector(popoverTrigger));
172+
173+
174+
await expectLink(page, `${popoverSelector} a:nth-of-type(2)`, {
172175
href: `http://localhost:4000/?page=log-create&lhcFillNumbers=6`, innerText: ' Add log to this fill'
173176
})
174177
// disable the popover
175-
await pressElement(page, `#row6-fillNumber-text > div:nth-child(1) > div:nth-child(2)`)
178+
await pressElement(page, popoverTrigger)
176179
})
177180

178181
it('can set how many lhcFills are available per page', async () => {

0 commit comments

Comments
 (0)