Skip to content
Open
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
28 changes: 28 additions & 0 deletions packages/main/cypress/specs/RatingIndicator.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,34 @@ import "@ui5/webcomponents-icons/dist/thumb-up.js";
import "@ui5/webcomponents-icons/dist/thumb-down.js";

describe("RatingIndicator", () => {
Comment thread
ndeshev marked this conversation as resolved.
describe("Default Icons Loading", () => {
it("should load and render the default 'favorite' and 'unfavorite' icons without explicit imports", () => {
cy.mount(<RatingIndicator value={3}></RatingIndicator>);

cy.get("[ui5-rating-indicator]")
.shadow()
.find(".ui5-rating-indicator-item-sel [ui5-icon]")
.first()
.shadow()
.find("svg path[d]")
.should("exist")
.and($path => {
expect($path.attr("d")).to.have.length.greaterThan(0);
});

cy.get("[ui5-rating-indicator]")
.shadow()
.find(".ui5-rating-indicator-item-unsel [ui5-icon]")
.first()
.shadow()
.find("svg path[d]")
.should("exist")
.and($path => {
expect($path.attr("d")).to.have.length.greaterThan(0);
});
});
});

describe("Custom Icons", () => {
it("should render default icons when no custom icons are specified", () => {
cy.mount(<RatingIndicator value={3}></RatingIndicator>);
Expand Down
2 changes: 2 additions & 0 deletions packages/main/src/RatingIndicator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import {
import { getEffectiveAriaLabelText } from "@ui5/webcomponents-base/dist/util/AccessibilityTextsHelper.js";
import i18n from "@ui5/webcomponents-base/dist/decorators/i18n.js";
import type I18nBundle from "@ui5/webcomponents-base/dist/i18nBundle.js";
import "@ui5/webcomponents-icons/dist/favorite.js";
import "@ui5/webcomponents-icons/dist/unfavorite.js";
import {
RATING_INDICATOR_TEXT,
RATING_INDICATOR_TOOLTIP_TEXT,
Expand Down
Loading