Skip to content

Commit

Permalink
chore(ui5-multi-combobox): adjust MultiComboBox spec
Browse files Browse the repository at this point in the history
Address failing test cases to correctly capture the click event on the
checkbox.
  • Loading branch information
kgogov committed Jan 23, 2025
1 parent 9eb764c commit 44a6564
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions packages/main/test/specs/MultiComboBox.mobile.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,34 +315,36 @@ describe("Items selection", () => {
});

it("should select all items when clicking select all", async () => {
const cb = await $("#mcb-select-all-vs");
const cb = await browser.$("#mcb-select-all-vs");
const popover = await cb.shadow$("ui5-responsive-popover");
const spanRef = await $("#select-all-event");
const selectAllCheckbox = await popover.$(".ui5-mcb-select-all-checkbox");
const selectAllCheckboxRoot = await selectAllCheckbox.shadow$(".ui5-checkbox-root");
const spanRef = await browser.$("#select-all-event");

await cb.click();

await popover.$(".ui5-mcb-select-all-checkbox").click();
await selectAllCheckboxRoot.click();
// ok button
await popover.$(".ui5-responsive-popover-footer").$("ui5-button").click();
assert.strictEqual(await spanRef.getText(), "Selected items count: 27");

await cb.click();
await popover.$(".ui5-mcb-select-all-checkbox").click();
await selectAllCheckboxRoot.click();
// ok button
await popover.$(".ui5-responsive-popover-footer").$("ui5-button").click();
assert.strictEqual(await spanRef.getText(), "Selected items count: 0");
});


it("select all should not be checked if all items are not selected", async () => {
const mcb = await $("#mcb-select-all-vs");
const mcb = await browser.$("#mcb-select-all-vs");
const popover = await mcb.shadow$("ui5-responsive-popover");
const closeIcon = await popover.$(".ui5-responsive-popover-close-btn");
const selectAllCheckbox = await popover.$(".ui5-mcb-select-all-checkbox");
const selectAllCheckboxRoot = await selectAllCheckbox.shadow$(".ui5-checkbox-root");

await mcb.click();

await selectAllCheckbox.click();
await selectAllCheckboxRoot.click();
await closeIcon.click();
await mcb.click();

Expand Down

0 comments on commit 44a6564

Please sign in to comment.