import{h}from"@stencil/core";import{newSpecPage}from"@stencil/core/testing";import{ScOrderTaxIdInput}from"../sc-order-tax-id-input";import{state as checkoutState,dispose as disposeCheckout}from"../../../../../store/checkout/index";beforeEach((()=>{disposeCheckout()})),describe("sc-order-tax-id-input",(()=>{it("renders",(async()=>{const t=await newSpecPage({components:[ScOrderTaxIdInput],html:"<sc-order-tax-id-input></sc-order-tax-id-input>"});expect(t.root).toMatchSnapshot()})),it("Renders UK VAT Tax Type",(async()=>{const t=await newSpecPage({components:[ScOrderTaxIdInput],template:()=>h("sc-order-tax-id-input",null)});checkoutState.checkout={id:"test",shipping_address:{country:"GB"}},await t.waitForChanges(),expect(t.root).toMatchSnapshot()})),it("Renders EU VAT Tax Type",(async()=>{const t=await newSpecPage({components:[ScOrderTaxIdInput],template:()=>h("sc-order-tax-id-input",null)});checkoutState.checkout={id:"test",shipping_address:{country:"DE"}},await t.waitForChanges(),expect(t.root).toMatchSnapshot()})),it("Renders CA Tax Type",(async()=>{const t=await newSpecPage({components:[ScOrderTaxIdInput],template:()=>h("sc-order-tax-id-input",null)});checkoutState.checkout={id:"test",shipping_address:{country:"CA"}},await t.waitForChanges(),expect(t.root).toMatchSnapshot()})),it("Renders AU Tax Type",(async()=>{const t=await newSpecPage({components:[ScOrderTaxIdInput],template:()=>h("sc-order-tax-id-input",null)});checkoutState.checkout={id:"test",shipping_address:{country:"AU"}},await t.waitForChanges(),expect(t.root).toMatchSnapshot()})),it("Defaults to type and number first",(async()=>{const t=await newSpecPage({components:[ScOrderTaxIdInput],template:()=>h("sc-order-tax-id-input",null)});checkoutState.checkout={id:"test",shipping_address:{country:"AU"},tax_identifier:{number:"123",number_type:"eu_vat"}},await t.waitForChanges(),expect(t.root).toMatchSnapshot()})),it("Renders with Help Text",(async()=>{const t=await newSpecPage({components:[ScOrderTaxIdInput],template:()=>h("sc-order-tax-id-input",{helpText:"Enter your tax identifier"})});expect(t.root).toMatchSnapshot()}))}));