import{newE2EPage}from"@stencil/core/testing";describe("cta-overlay-ui",(()=>{let t,e;beforeEach((async()=>{t=await newE2EPage(),await t.setContent("<presto-cta-overlay-ui></presto-cta-overlay-ui>"),e=await t.find("presto-cta-overlay-ui"),expect(e).toHaveClass("hydrated")})),it("renders",(async()=>{expect(e).toHaveClass("hydrated")})),it("Has a button",(async()=>{await t.$eval("presto-cta-overlay-ui",(t=>{t.buttonLink={url:"#test"},t.showButton=!0,t.buttonText="Button Text"})),await t.waitForChanges();const e=await t.evaluateHandle("document.querySelector('presto-cta-overlay-ui').shadowRoot.querySelector('.button')");expect(e).not.toBe(null);const a=await t.evaluate((t=>{const e=window.getComputedStyle(t);return e&&"none"!==e.display&&"hidden"!==e.visibility&&"0"!==e.opacity}),e);expect(a).toBe(!0);const o=await t.evaluate((t=>"_self"===t.getAttribute("target")),e);expect(o).toBe(!0),await e.click();const i=await t.evaluate((()=>location.href));expect(i).toContain("#test")})),it("Can open in a new tab",(async()=>{await t.$eval("presto-cta-overlay-ui",(t=>{t.buttonLink={url:"#test",opensInNewTab:!0},t.showButton=!0,t.buttonText="Button Text"})),await t.waitForChanges();const e=(await t.find("presto-cta-overlay-ui")).shadowRoot.querySelector(".button");expect(e).toBeDefined(),expect(e).toHaveAttribute("target","_blank")})),it("Can be clickable",(async()=>{e.setProperty("buttonLink",{url:"#test"}),await t.waitForChanges(),await e.click();const a=await t.evaluate((()=>location.href));expect(a).toContain("#test")})),it("Has a skip button",(async()=>{e.setProperty("allowSkip",!0),await t.waitForChanges();const a=await t.find("presto-cta-overlay-ui");let o=a.shadowRoot.querySelector(".skip");expect(o).toBeDefined(),e.setProperty("i18n",{skip:"Test Skip Text"}),await t.waitForChanges(),o=a.shadowRoot.querySelector(".skip"),expect(o).toBeDefined(),expect(o.innerText).toContain("Test Skip Text")})),it("has a headline",(async()=>{e.setProperty("headline","This is a headline"),await t.waitForChanges();const a=await t.find("presto-cta-overlay-ui");let o=await a.shadowRoot.querySelector("h1");expect(o).toBeDefined(),expect(o.innerText).toContain("This is a headline")})),it("Has a description",(async()=>{e.setProperty("bottomText","This is bottom text"),await t.waitForChanges();let a=(await t.find("presto-cta-overlay-ui")).shadowRoot.querySelector("p");expect(a).toBeDefined(),expect(a.innerText).toContain("This is bottom text")}))}));