mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-09-21 04:07:54 +03:00
Adjust the tests to not rely on parent-button-clicks
This commit is contained in:
parent
359b26d617
commit
fd584d56b2
@ -84,9 +84,7 @@ view model =
|
||||
, Container.custom [ Events.onClick ParentClick ]
|
||||
, Container.css [ Css.maxWidth (Css.px 500) ]
|
||||
]
|
||||
, p [ id "parent-button-clicks" ]
|
||||
[ text ("Parent Clicks: " ++ String.fromInt model.parentClicks)
|
||||
]
|
||||
, Text.mediumBody [ Text.plaintext ("Parent Clicks: " ++ String.fromInt model.parentClicks) ]
|
||||
]
|
||||
|
||||
|
||||
|
@ -190,15 +190,8 @@ describe("UI tests", function () {
|
||||
location
|
||||
) => {
|
||||
await defaultUsageExampleProcessing(testName, name, location);
|
||||
await page.waitForSelector("#parent-button-clicks");
|
||||
|
||||
const getCounterText = async () => {
|
||||
const counter = await page.$("#parent-button-clicks");
|
||||
const text = await page.evaluate((el) => el.innerText, counter);
|
||||
return text;
|
||||
};
|
||||
|
||||
assert.equal(await getCounterText(), "Parent Clicks: 0");
|
||||
await page.waitForXPath("//p[contains(., 'Parent Clicks: 0')]", 200 );
|
||||
await page.waitForSelector("[data-tooltip-visible=false]");
|
||||
|
||||
// Opening and closing the tooltip doesn't trigger the container effects
|
||||
@ -207,18 +200,19 @@ describe("UI tests", function () {
|
||||
|
||||
await page.click('[aria-label="Tooltip trigger"]');
|
||||
await page.waitForSelector("[data-tooltip-visible=false]");
|
||||
assert.equal(await getCounterText(), "Parent Clicks: 0");
|
||||
|
||||
await page.waitForXPath("//p[contains(., 'Parent Clicks: 0')]", 200 );
|
||||
|
||||
// Clicking the button does trigger container effects
|
||||
const [button] = await page.$x("//button[contains(., 'Click me')]");
|
||||
await button.click();
|
||||
|
||||
assert.equal(await getCounterText(), "Parent Clicks: 1");
|
||||
await page.waitForXPath("//p[contains(., 'Parent Clicks: 1')]", 200 );
|
||||
|
||||
// Clicking the container does trigger container effects
|
||||
const [container] = await page.$x("//div[contains(., 'in the Container!')]");
|
||||
await container.click();
|
||||
assert.equal(await getCounterText(), "Parent Clicks: 2");
|
||||
await page.waitForXPath("//p[contains(., 'Parent Clicks: 2')]", 200 );
|
||||
};
|
||||
|
||||
const skippedRules = {
|
||||
|
Loading…
Reference in New Issue
Block a user