import{newE2EPage}from"@stencil/core/testing";describe("sc-button",(()=>{let t,a,e;const i="sc-button";beforeEach((async()=>{t=await newE2EPage(),await t.setContent(`<${i}></${i}>`),a=await t.find(`${i}`),e=await t.find(`${i} >>> .button`)})),it("renders",(async()=>{const t=await newE2EPage();await t.setContent("<sc-button></sc-button>");const a=await t.find("sc-button");expect(a).toHaveClass("hydrated")})),it("Has types",(async()=>{e=await t.find(`${i} >>> .button`),expect(e).toHaveClass("button--default"),await t.$eval(i,(t=>{t.type="primary"})),await t.waitForChanges(),e=await t.find(`${i} >>> .button`),expect(e).toHaveClass("button--primary"),await t.$eval(i,(t=>{t.type="success"})),await t.waitForChanges(),e=await t.find(`${i} >>> .button`),expect(e).toHaveClass("button--success"),await t.$eval(i,(t=>{t.type="info"})),await t.waitForChanges(),e=await t.find(`${i} >>> .button`),expect(e).toHaveClass("button--info"),await t.$eval(i,(t=>{t.type="warning"})),await t.waitForChanges(),e=await t.find(`${i} >>> .button`),expect(e).toHaveClass("button--warning"),await t.$eval(i,(t=>{t.type="danger"})),await t.waitForChanges(),e=await t.find(`${i} >>> .button`),expect(e).toHaveClass("button--danger"),await t.$eval(i,(t=>{t.type="text"})),await t.waitForChanges(),e=await t.find(`${i} >>> .button`),expect(e).toHaveClass("button--text")})),it("Has sizes",(async()=>{e=await t.find(`${i} >>> .button`),expect(e).toHaveClass("button--medium"),await t.$eval(i,(t=>{t.size="large"})),await t.waitForChanges(),e=await t.find(`${i} >>> .button`),expect(e).toHaveClass("button--large"),await t.$eval(i,(t=>{t.size="small"})),await t.waitForChanges(),e=await t.find(`${i} >>> .button`),expect(e).toHaveClass("button--small")})),it("Can be full",(async()=>{await t.$eval(i,(t=>{t.full=!0})),await t.waitForChanges(),expect(a.hasAttribute("full"))})),it("Can be disabled",(async()=>{e=await t.find(`${i} >>> .button`),expect(e).not.toHaveClass("button--disabled"),await t.$eval(i,(t=>{t.disabled=!0})),await t.waitForChanges(),e=await t.find(`${i} >>> .button`),expect(e).toHaveClass("button--disabled"),expect(e).toHaveAttribute("disabled")})),it("Can be loading",(async()=>{e=await t.find(`${i} >>> .button`),expect(e).not.toHaveClass("button--loading"),await t.$eval(i,(t=>{t.loading=!0})),await t.waitForChanges();const a=await t.find(`${i} >>> sc-spinner`);let n=await a.isVisible();expect(n).toBe(!0),e=await t.find(`${i} >>> .button`),expect(e).toHaveClass("button--loading")})),it("Can be pill",(async()=>{e=await t.find(`${i} >>> .button`),expect(e).not.toHaveClass("button--pill"),await t.$eval(i,(t=>{t.pill=!0})),await t.waitForChanges(),e=await t.find(`${i} >>> .button`),expect(e).toHaveClass("button--pill")})),it("Can be circle",(async()=>{e=await t.find(`${i} >>> .button`),expect(e).not.toHaveClass("button--circle"),await t.$eval(i,(t=>{t.circle=!0})),await t.waitForChanges(),e=await t.find(`${i} >>> .button`),expect(e).toHaveClass("button--circle")})),it("Can be type submit",(async()=>{e=await t.find(`${i} >>> .button`),expect(e.getAttribute("type")).toBe("button"),await t.$eval(i,(t=>{t.submit=!0})),await t.waitForChanges(),e=await t.find(`${i} >>> .button`),expect(e.getAttribute("type")).toBe("submit")})),it("Can have a name",(async()=>{e=await t.find(`${i} >>> .button`),expect(e.getAttribute("name")).toBe(null),await t.$eval(i,(t=>{t.name="Test"})),await t.waitForChanges(),e=await t.find(`${i} >>> .button`),expect(e.getAttribute("name")).toBe("Test")})),it("Can have a value",(async()=>{e=await t.find(`${i} >>> .button`),expect(e.getAttribute("value")).toBe(null),await t.$eval(i,(t=>{t.value="Test"})),await t.waitForChanges(),e=await t.find(`${i} >>> .button`),expect(e.getAttribute("value")).toBe("Test")})),it("Can be a link",(async()=>{e=await t.find(`${i} >>> .button`),expect(e.getAttribute("href")).toBe(null),await t.$eval(i,(t=>{t.href="https://google.com",t.target="_blank",t.download="test"})),await t.waitForChanges();const a=await t.find(`${i} >>> a.button`);let n=await a.isVisible();expect(n).toBe(!0),expect(a.getAttribute("href")).toBe("https://google.com"),expect(a.getAttribute("target")).toBe("_blank"),expect(a.getAttribute("download")).toBe("test")}))}));