Skip to content

Commit c6ce6f2

Browse files
committed
chore: update Select component tests
1 parent 68dc349 commit c6ce6f2

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

packages/main/cypress/specs/Select.cy.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,47 +1396,47 @@ describe("Select general interaction", () => {
13961396

13971397
it("navigates with ArrowDown when initial value does not match any option", () => {
13981398
cy.mount(
1399-
<Select id="sel-down" value="missing">
1399+
<Select value="missing">
14001400
<Option value="A">A</Option>
14011401
<Option value="B">B</Option>
14021402
<Option value="C">C</Option>
14031403
</Select>
14041404
);
14051405

1406-
cy.get("#sel-down")
1407-
.should("have.attr", "value", "missing")
1406+
cy.get("[ui5-select]")
1407+
.should("have.prop", "value", "missing")
14081408
.find("[ui5-option][selected]")
14091409
.should("not.exist");
14101410

1411-
cy.get("#sel-down").realClick().realPress("ArrowDown");
1411+
cy.get("[ui5-select]").realClick().realPress("ArrowDown");
14121412

1413-
cy.get("#sel-down")
1413+
cy.get("[ui5-select]")
14141414
.find("[ui5-option]")
14151415
.eq(0)
14161416
.should("have.attr", "selected");
1417-
cy.get("#sel-down").should("have.prop", "value", "A");
1417+
cy.get("[ui5-select]").should("have.prop", "value", "A");
14181418
});
14191419

14201420
it("navigates with ArrowUp when initial value does not match any option", () => {
14211421
cy.mount(
1422-
<Select id="sel-up" value="missing">
1422+
<Select value="missing">
14231423
<Option value="A">A</Option>
14241424
<Option value="B">B</Option>
14251425
<Option value="C">C</Option>
14261426
</Select>
14271427
);
14281428

1429-
cy.get("#sel-up")
1430-
.should("have.attr", "value", "missing")
1429+
cy.get("[ui5-select]")
1430+
.should("have.prop", "value", "missing")
14311431
.find("[ui5-option][selected]")
14321432
.should("not.exist");
14331433

1434-
cy.get("#sel-up").realClick().realPress("ArrowUp");
1434+
cy.get("[ui5-select]").realClick().realPress("ArrowUp");
14351435

1436-
cy.get("#sel-up")
1436+
cy.get("[ui5-select]")
14371437
.find("[ui5-option]")
14381438
.eq(2)
14391439
.should("have.attr", "selected");
1440-
cy.get("#sel-up").should("have.prop", "value", "C");
1440+
cy.get("[ui5-select]").should("have.prop", "value", "C");
14411441
});
14421442
});

0 commit comments

Comments
 (0)