import{newE2EPage}from"@stencil/core/testing";describe("sc-choice",(()=>{let e,t,a,c;const i="sc-choice";beforeEach((async()=>{e=await newE2EPage(),await e.setContent(`<${i}></${i}>`),t=await e.find(`${i}`),a=await e.find(`${i} >>> .choice`),c=await e.find(`${i} >>> input`)})),it("renders",(async()=>{const e=await newE2EPage();await e.setContent("<sc-choice></sc-choice>");const t=await e.find(i);expect(t).toHaveClass("hydrated")})),it("Should be clickable",(async()=>{const t=await e.spyOnEvent("scBlur"),o=await e.spyOnEvent("scFocus");expect(a).toHaveClass("choice"),expect(a).not.toHaveClasses(["choice--checked","choice--focused"]),await c.click(),await e.waitForChanges(),expect(a).toHaveClass("choice"),expect(a).toHaveClasses(["choice--checked","choice--focused"]),expect(o).toHaveReceivedEvent(),await e.$eval(i,(e=>e.blur())),await e.waitForChanges(),expect(a).not.toHaveClass("choice--focused"),expect(t).toHaveReceivedEvent()})),it("Can be disabled",(async()=>{expect(c).not.toHaveAttribute("disabled"),t.setProperty("disabled",!0),await e.waitForChanges(),expect(a).toHaveClasses(["choice","choice--disabled"]),expect(c).toHaveAttribute("disabled")})),it("Can be radio or checkbox",(async()=>{expect(c).toEqualAttribute("type","radio"),t.setProperty("type","checkbox"),await e.waitForChanges(),expect(c).toEqualAttribute("type","checkbox")}))}));