Skip to content
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
c33705c
feat(ui5-banner): work in progress
tsanislavgatev Mar 9, 2026
566f79d
feat(ui5-banner): add theming and samples
tsanislavgatev Mar 12, 2026
a9e4c45
fix(ui5-banner): add one more sample
tsanislavgatev Mar 12, 2026
2f4ba83
feat(ui5-banner): improve component and sample according to design re…
tsanislavgatev Mar 23, 2026
90a006a
feat(ui5-banner): add new samples and background
tsanislavgatev Mar 25, 2026
4fa7392
fix(ui5-banner): fix latest comments
tsanislavgatev Apr 2, 2026
f0338a7
Merge branch 'main' into header-banner-poc
tsanislavgatev Apr 3, 2026
60a7d58
fix(ui5-banner): apply new ideas
tsanislavgatev Apr 6, 2026
abccaa3
Merge branch 'main' into header-banner-poc
tsanislavgatev Apr 21, 2026
84a3a5c
Merge branch 'main' into header-banner-poc
tsanislavgatev Apr 28, 2026
1f45f99
Merge branch 'main' into header-banner-poc
tsanislavgatev Apr 28, 2026
24c46bb
feat(ui5-banner): apply css variable
tsanislavgatev Apr 29, 2026
fa0b62a
Merge branch 'main' into header-banner-poc
GDamyanov May 5, 2026
01be0ae
Merge branch 'main' into header-banner-poc
GDamyanov May 12, 2026
120e8f3
add samples
tsanislavgatev May 12, 2026
f5b5813
fix(ui5-banner): fix comments
tsanislavgatev May 12, 2026
36264c9
fix(ui5-banner): fix comments
tsanislavgatev May 13, 2026
e57012f
fix(ui5-banner): fix URL sanitizer preserving path slashes
tsanislavgatev May 13, 2026
22328e1
Merge branch 'main' into header-banner-poc
GDamyanov May 14, 2026
b0c1c3e
fix(ui5-banner): fix default styling
tsanislavgatev May 18, 2026
cc3667f
fix(ui5-hero-banner): rename component
tsanislavgatev May 20, 2026
7669391
fix(ui5-hero-banner): fix comments and feedback
tsanislavgatev May 26, 2026
8dfcda4
fix(ui5-hero-banner): update samples
tsanislavgatev May 27, 2026
f1129f8
fix(ui5-hero-banner): update samples
tsanislavgatev May 27, 2026
22934cc
Merge branch 'main' into header-banner-poc
GDamyanov May 28, 2026
28a7ed0
Merge branch 'main' into header-banner-poc
GDamyanov May 28, 2026
778ed0b
Merge branch 'main' into header-banner-poc
GDamyanov May 28, 2026
258a1a3
fix(ui5-hero-banner): fix lint issues
tsanislavgatev May 28, 2026
8368801
fix(ui5-hero-banner): remove index page changes
tsanislavgatev May 29, 2026
d3f1dd6
fix: remove background image property
GDamyanov Jun 2, 2026
2856f47
refactor: rename slot
GDamyanov Jun 2, 2026
e35d07d
feat: add new property for slot placement
GDamyanov Jun 3, 2026
eaf500c
feat: add two properties for actions and header position
GDamyanov Jun 3, 2026
94ae140
fix: broken scenarious
GDamyanov Jun 3, 2026
896bdde
Merge branch 'main' into header-banner-poc
GDamyanov Jun 3, 2026
5ec4252
fix: aling items
GDamyanov Jun 3, 2026
ace185a
refactor: rename enum HeaderActionsPosition to HeaderActionsPlacement
GDamyanov Jun 3, 2026
8c4454e
refactor: rename enum HeaderTextPosition to HeaderTextBlockPlacement
GDamyanov Jun 3, 2026
0b44e85
refactor: rename enum values and update jsdocs
GDamyanov Jun 3, 2026
48d9fa8
refactor: since overriding a private variable is not a good practise …
GDamyanov Jun 3, 2026
92c75e6
refactor: update jsdoc
GDamyanov Jun 3, 2026
d16c6d8
fix: make endcontent responsive when it is on full height
GDamyanov Jun 3, 2026
08ba925
fix: fix samples
GDamyanov Jun 3, 2026
c3938ba
refactor: rename enum
GDamyanov Jun 4, 2026
7e2c3f7
refactor: change the layout property to columnsRatio
GDamyanov Jun 4, 2026
541f646
fix: fix responsive issues
GDamyanov Jun 4, 2026
5dfbba7
fix: fix properly behaviour issues
GDamyanov Jun 4, 2026
0c68b61
refactor: remove background image property
GDamyanov Jun 4, 2026
33cf790
feat: add samples
GDamyanov Jun 4, 2026
91fd79c
Merge branch 'main' into header-banner-poc
GDamyanov Jun 4, 2026
0313585
fix: add missing styles
GDamyanov Jun 4, 2026
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
267 changes: 267 additions & 0 deletions packages/fiori/cypress/specs/Banner.cy.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
import Banner from "../../src/Banner.js";

describe("Banner", () => {
describe("Rendering", () => {
it("renders with default configuration", () => {
cy.mount(
<Banner salutationText="Hello, John"></Banner>
);

cy.get("[ui5-banner]")
.shadow()
.find(".ui5-banner-root")
.should("exist");

cy.get("[ui5-banner]")
.shadow()
.find(".ui5-banner-salutation")
.should("have.text", "Hello, John");
});

it("renders salutation text", () => {
cy.mount(
<Banner salutationText="Good Morning, Jane"></Banner>
);

cy.get("[ui5-banner]")
.shadow()
.find(".ui5-banner-salutation")
.should("have.text", "Good Morning, Jane");
});

it("renders date text when provided", () => {
cy.mount(
<Banner salutationText="Hello, John" dateText="March 6, 2026"></Banner>
);

cy.get("[ui5-banner]")
.shadow()
.find(".ui5-banner-date")
.should("have.text", "March 6, 2026");
});

it("does not render date element when dateText is not set", () => {
cy.mount(
<Banner salutationText="Hello, John"></Banner>
);

cy.get("[ui5-banner]")
.shadow()
.find(".ui5-banner-date")
.should("not.exist");
});

it("does not render salutation element when salutationText is not set", () => {
cy.mount(
<Banner></Banner>
);

cy.get("[ui5-banner]")
.shadow()
.find(".ui5-banner-salutation")
.should("not.exist");
});
});

describe("Layout", () => {
it("applies FullWidth layout by default", () => {
cy.mount(
<Banner salutationText="Hello, John">
<div>Start</div>
</Banner>
);

cy.get("[ui5-banner]")
.shadow()
.find(".ui5-banner-layout-FullWidth")
.should("exist");
});

it("applies HalfWidth layout", () => {
cy.mount(
<Banner salutationText="Hello" layout="HalfWidth">
<div>Start</div>
<div slot="endContent">End</div>
</Banner>
);

cy.get("[ui5-banner]")
.shadow()
.find(".ui5-banner-layout-HalfWidth")
.should("exist");
});

it("applies TwoThirds layout", () => {
cy.mount(
<Banner salutationText="Hello" layout="TwoThirds">
<div>Start</div>
<div slot="endContent">End</div>
</Banner>
);

cy.get("[ui5-banner]")
.shadow()
.find(".ui5-banner-layout-TwoThirds")
.should("exist");
});
});

describe("Slots", () => {
it("renders startContent slot", () => {
cy.mount(
<Banner salutationText="Hello">
<div id="start-block">Start Content</div>
</Banner>
);

cy.get("[ui5-banner]")
.find("#start-block")
.should("exist")
.and("have.text", "Start Content");
});

it("renders endContent slot", () => {
cy.mount(
<Banner salutationText="Hello">
<div slot="endContent" id="end-block">End Content</div>
</Banner>
);

cy.get("[ui5-banner]")
.find("#end-block")
.should("exist")
.and("have.text", "End Content");
});

it("renders both startContent and endContent in HalfWidth layout", () => {
cy.mount(
<Banner salutationText="Hello" layout="HalfWidth">
<div id="start">Left</div>
<div slot="endContent" id="end">Right</div>
</Banner>
);

cy.get("[ui5-banner]")
.find("#start")
.should("exist");

cy.get("[ui5-banner]")
.find("#end")
.should("exist");

cy.get("[ui5-banner]")
.shadow()
.find(".ui5-banner-block-start")
.should("exist");

cy.get("[ui5-banner]")
.shadow()
.find(".ui5-banner-block-end")
.should("exist");
});
});

describe("Background Image", () => {
it("applies background image when set", () => {
cy.mount(
<Banner
salutationText="Hello"
backgroundImage="https://example.com/image.jpg"
></Banner>
);

cy.get("[ui5-banner]")
.shadow()
.find(".ui5-banner-root")
.should("have.class", "ui5-banner--has-bg-image")
.and("have.attr", "style")
.and("include", "background-image");
});

it("does not apply background image class when not set", () => {
cy.mount(
<Banner salutationText="Hello"></Banner>
);

cy.get("[ui5-banner]")
.shadow()
.find(".ui5-banner-root")
.should("not.have.class", "ui5-banner--has-bg-image");
});
});

describe("Height constraints", () => {
it("respects minimum height", () => {
cy.mount(
<Banner salutationText="Hello"></Banner>
);

cy.get("[ui5-banner]")
.shadow()
.find(".ui5-banner-root")
.invoke("css", "min-height")
.should("equal", "92px"); // 5.75rem = 92px at default font-size
});
});

describe("Properties", () => {
it("updates salutationText dynamically", () => {
cy.mount(
<Banner salutationText="Hello, John"></Banner>
);

cy.get("[ui5-banner]")
.shadow()
.find(".ui5-banner-salutation")
.should("have.text", "Hello, John");

cy.get("[ui5-banner]")
.invoke("prop", "salutationText", "Hello, Jane");

cy.get("[ui5-banner]")
.shadow()
.find(".ui5-banner-salutation")
.should("have.text", "Hello, Jane");
});

it("updates dateText dynamically", () => {
cy.mount(
<Banner salutationText="Hello" dateText="March 6"></Banner>
);

cy.get("[ui5-banner]")
.shadow()
.find(".ui5-banner-date")
.should("have.text", "March 6");

cy.get("[ui5-banner]")
.invoke("prop", "dateText", "March 7");

cy.get("[ui5-banner]")
.shadow()
.find(".ui5-banner-date")
.should("have.text", "March 7");
});

it("updates layout dynamically", () => {
cy.mount(
<Banner salutationText="Hello" layout="FullWidth">
<div>Start</div>
</Banner>
);

cy.get("[ui5-banner]")
.shadow()
.find(".ui5-banner-layout-FullWidth")
.should("exist");

cy.get("[ui5-banner]")
.invoke("prop", "layout", "HalfWidth");

cy.get("[ui5-banner]")
.shadow()
.find(".ui5-banner-layout-HalfWidth")
.should("exist");
});
});
});
Loading
Loading