import{h}from"@stencil/core";import{newSpecPage}from"@stencil/core/testing";import{ScCouponForm}from"../sc-coupon-form";describe("sc-coupon-form",(()=>{it("renders",(async()=>{const o=await newSpecPage({components:[ScCouponForm],html:"<sc-coupon-form></sc-coupon-form>"});expect(o.root).toMatchSnapshot()})),it("renders collapsed",(async()=>{const o=await newSpecPage({components:[ScCouponForm],html:"<sc-coupon-form collapsed></sc-coupon-form>"});expect(o.root).toMatchSnapshot()})),it("handles applied coupons",(async()=>{const o=await newSpecPage({components:[ScCouponForm],template:()=>h("sc-coupon-form",{discount:{coupon:{percent_off:25,currency:"usd"},promotion:{code:"TESTCODE"}},discountAmount:725,currency:"usd"})});expect(o.root).toMatchSnapshot()})),it("handles recurring coupons with repeating duration",(async()=>{const o=await newSpecPage({components:[ScCouponForm],template:()=>h("sc-coupon-form",{showInterval:!0,discount:{coupon:{percent_off:25,currency:"usd",duration:"repeating",duration_in_months:3},promotion:{code:"TESTCODE"}},discountAmount:725,currency:"usd"})});expect(o.root).toMatchSnapshot()})),it("handles recurring coupons with forever duration",(async()=>{const o=await newSpecPage({components:[ScCouponForm],template:()=>h("sc-coupon-form",{showInterval:!0,discount:{coupon:{percent_off:25,currency:"usd",duration:"forever"},promotion:{code:"TESTCODE"}},discountAmount:725,currency:"usd"})});expect(o.root).toMatchSnapshot()})),it("handles recurring coupons with once duration",(async()=>{const o=await newSpecPage({components:[ScCouponForm],template:()=>h("sc-coupon-form",{showInterval:!0,discount:{coupon:{percent_off:25,currency:"usd",duration:"once"},promotion:{code:"TESTCODE"}},discountAmount:725,currency:"usd"})});expect(o.root).toMatchSnapshot()}))}));