|
9 | 9 | createCarousel, |
10 | 10 | createChart, |
11 | 11 | paste, |
| 12 | + selectCarouselItem, |
12 | 13 | updateCarousel, |
13 | 14 | } from "../../test_helpers/commands_helpers"; |
14 | 15 | import { click, clickAndDrag, getElStyle, triggerMouseEvent } from "../../test_helpers/dom_helper"; |
@@ -164,6 +165,25 @@ describe("Carousel figure component", () => { |
164 | 165 | expect(getElStyle(".o-figure .o-carousel-title", "font-weight")).toBe("bold"); |
165 | 166 | }); |
166 | 167 |
|
| 168 | + test("Carousel header has the correct background color", async () => { |
| 169 | + createCarousel(model, { items: [], title: { text: "Title" } }, "carouselId"); |
| 170 | + await mountSpreadsheet({ model }); |
| 171 | + |
| 172 | + // Empty carousel |
| 173 | + expect(".o-carousel-header").toHaveStyle({ "background-color": "#FFFFFF" }); |
| 174 | + |
| 175 | + // Carousel with data view |
| 176 | + updateCarousel(model, "carouselId", { items: [{ type: "carouselDataView" }] }); |
| 177 | + await nextTick(); |
| 178 | + expect(".o-carousel-header").toHaveStyle({ "background-color": "#FFFFFF" }); |
| 179 | + |
| 180 | + // Carousel with chart |
| 181 | + const chartId = addNewChartToCarousel(model, "carouselId", { background: "#123456" }); |
| 182 | + selectCarouselItem(model, "carouselId", { type: "chart", chartId }); |
| 183 | + await nextTick(); |
| 184 | + expect(".o-carousel-header").toHaveStyle({ "background-color": "#123456" }); |
| 185 | + }); |
| 186 | + |
167 | 187 | test("display chart menu", async () => { |
168 | 188 | createCarousel(model, { items: [{ type: "carouselDataView" }] }, "carouselId"); |
169 | 189 | addNewChartToCarousel(model, "carouselId", { type: "bar" }); |
|
0 commit comments