Skip to content

Commit

Permalink
fix(ui5-select): added a unit test for scroll to selected item
Browse files Browse the repository at this point in the history
  • Loading branch information
kgogov committed Aug 24, 2023
1 parent 5c9bcb4 commit e528911
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/main/test/specs/Select.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,24 @@ describe("Select general interaction", () => {
await firstItem.click();
assert.notOk(await popover.getProperty("opened"), "Select is closed.");
});

it("Tests if currently selected option is visible in the viewport when keyboard navigation is used", async () => {
await browser.setWindowSize(600, 100);

const select = await browser.$("#warningSelect");
const staticAreaItemClassName = await browser.getStaticAreaItemClassName("#warningSelect");
const popover = await browser.$(`.${staticAreaItemClassName}`).shadow$("ui5-responsive-popover");

await select.click();
assert.ok(await popover.getProperty("opened"), "Select is opened.");

await select.keys("ArrowDown");
await select.keys("ArrowDown");
await select.keys("ArrowDown");

const selectedOption = await popover.$("ui5-list").$("ui5-li[selected]");
assert.ok(await selectedOption.isClickable(), "Selected option is visible in the viewport.");
});
});

describe("Attributes propagation", () => {
Expand Down

0 comments on commit e528911

Please sign in to comment.