Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/main/cypress/specs/DatePicker.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import "../../src/Assets.js";
import { setLanguage } from "@ui5/webcomponents-base/dist/config/Language.js";
import DatePicker from "../../src/DatePicker.js";
import Label from "../../src/Label.js";
import { DATEPICKER_POPOVER_ACCESSIBLE_NAME } from "../../src/generated/i18n/i18n-defaults.js";

describe("Date Picker Tests", () => {

Expand Down Expand Up @@ -1994,7 +1995,7 @@ describe("Accessibility", () => {
cy.get<DatePicker>("@datePicker")
.shadow()
.find("ui5-responsive-popover")
.should("have.attr", "accessible-name", `Choose Date for ${LABEL}`);
.should("have.attr", "accessible-name", DatePicker.i18nBundle.getText(DATEPICKER_POPOVER_ACCESSIBLE_NAME, LABEL));
});

it("picker popover accessible name", () => {
Expand All @@ -2010,7 +2011,7 @@ describe("Accessibility", () => {
cy.get<DatePicker>("@datePicker")
.shadow()
.find("ui5-responsive-popover")
.should("have.attr", "accessible-name", `Choose Date for ${LABEL}`);
.should("have.attr", "accessible-name", DatePicker.i18nBundle.getText(DATEPICKER_POPOVER_ACCESSIBLE_NAME, LABEL));
});

it("accessibleDescription property", () => {
Expand Down
17 changes: 9 additions & 8 deletions packages/main/cypress/specs/RangeSlider.cy.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import RangeSlider from "../../src/RangeSlider.js";
import { RANGE_SLIDER_START_HANDLE_DESCRIPTION, RANGE_SLIDER_END_HANDLE_DESCRIPTION } from "../../src/generated/i18n/i18n-defaults.js";

describe("Testing Range Slider interactions", () => {
it("Changing the current startValue is reflected", () => {
Expand Down Expand Up @@ -874,7 +875,7 @@ describe("Testing events", () => {
const startValue = rangeSlider.startValue;

cy.get("@startHandle")
.should("have.attr", "aria-label", "Left handle");
.should("have.attr", "aria-label", RangeSlider.i18nBundle.getText(RANGE_SLIDER_START_HANDLE_DESCRIPTION));

cy.get("@startHandle")
.should("have.attr", "aria-valuemin", `${minValue}`);
Expand Down Expand Up @@ -903,7 +904,7 @@ describe("Testing events", () => {
const endValue = rangeSlider.endValue;

cy.get("@endHandle")
.should("have.attr", "aria-label", "Right handle");
.should("have.attr", "aria-label", RangeSlider.i18nBundle.getText(RANGE_SLIDER_END_HANDLE_DESCRIPTION));

cy.get("@endHandle")
.should("have.attr", "aria-valuemin", `${minValue}`);
Expand All @@ -929,17 +930,17 @@ describe("Testing events", () => {
.find("[ui5-slider-handle][handle-type='End']")
.as("endHandle");

cy.get("@startHandle").should("have.attr", "aria-label", "Left handle");
cy.get("@endHandle").should("have.attr", "aria-label", "Right handle");
cy.get("@startHandle").should("have.attr", "aria-label", RangeSlider.i18nBundle.getText(RANGE_SLIDER_START_HANDLE_DESCRIPTION));
cy.get("@endHandle").should("have.attr", "aria-label", RangeSlider.i18nBundle.getText(RANGE_SLIDER_END_HANDLE_DESCRIPTION));

// Drag start handle past end handle to swap values using real events
cy.get("@startHandle")
.realMouseDown()
.realMouseMove(100, 0)
.realMouseUp();

cy.get("@startHandle").should("have.attr", "aria-label", "Left handle");
cy.get("@endHandle").should("have.attr", "aria-label", "Right handle");
cy.get("@startHandle").should("have.attr", "aria-label", RangeSlider.i18nBundle.getText(RANGE_SLIDER_START_HANDLE_DESCRIPTION));
cy.get("@endHandle").should("have.attr", "aria-label", RangeSlider.i18nBundle.getText(RANGE_SLIDER_END_HANDLE_DESCRIPTION));
});

it("Click anywhere in the Range Slider should focus the closest handle", () => {
Expand Down Expand Up @@ -1811,12 +1812,12 @@ describe("Accessibility", () => {
cy.get("[ui5-range-slider]")
.shadow()
.find("[ui5-slider-handle][handle-type='Start']")
.should("have.attr", "aria-label", `${labelText} Left handle`);
.should("have.attr", "aria-label", `${labelText} ${RangeSlider.i18nBundle.getText(RANGE_SLIDER_START_HANDLE_DESCRIPTION)}`);

cy.get("[ui5-range-slider]")
.shadow()
.find("[ui5-slider-handle][handle-type='End']")
.should("have.attr", "aria-label", `${labelText} Right handle`);
.should("have.attr", "aria-label", `${labelText} ${RangeSlider.i18nBundle.getText(RANGE_SLIDER_END_HANDLE_DESCRIPTION)}`);
});

it("Aria attributes of the progress bar are set correctly", () => {
Expand Down
Loading