-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ui5-rating-indicator): correct half icon appearance (#10263)
FIXES: #10155
- Loading branch information
1 parent
51139c2
commit 3032393
Showing
3 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { html } from "lit"; | ||
import "../../src/RatingIndicator.js"; | ||
|
||
describe("RatingIndicator", () => { | ||
describe("Half Icon appearance", () => { | ||
it("Half icon should be filled when rating indicator is disabled", () => { | ||
const attributeValue = "favorite"; | ||
|
||
cy.mount(html`<ui5-rating-indicator value="2.5" disabled></ui5-rating-indicator>`); | ||
|
||
cy.get("[ui5-rating-indicator]") | ||
.shadow() | ||
.find(".ui5-rating-indicator-item-half [ui5-icon]") | ||
.should("have.attr", "name", attributeValue); | ||
}); | ||
|
||
it("Half icon should be filled when rating indicator is readonly", () => { | ||
const attributeValue = "favorite"; | ||
|
||
cy.mount(html`<ui5-rating-indicator value="2.5" readonly></ui5-rating-indicator>`); | ||
|
||
cy.get("[ui5-rating-indicator]") | ||
.shadow() | ||
.find(".ui5-rating-indicator-item-half [ui5-icon]") | ||
.should("have.attr", "name", attributeValue); | ||
}); | ||
|
||
it("Half icon should be border only when rating indicator is regular", () => { | ||
const attributeValue = "unfavorite"; | ||
|
||
cy.mount(html`<ui5-rating-indicator value="2.5"></ui5-rating-indicator>`); | ||
|
||
cy.get("[ui5-rating-indicator]") | ||
.shadow() | ||
.find(".ui5-rating-indicator-item-half [ui5-icon]") | ||
.should("have.attr", "name", attributeValue); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters