import{getSessionId}from"../index";describe("Checkout session helpers",(()=>{describe("getSessionId",(()=>{it("Should return the checkout session id if it already exists",(async()=>{expect(getSessionId("asdf",{id:"existing"},"")).toBe("existing")})),it("Should get the checkout session from the url, first",(async()=>{delete window.location,window.location=new URL("https://www.example.com?checkout_id=urltest"),expect(getSessionId("asdf",{},"")).toBe("urltest")})),it("Should get the checkout session from localstorage, second",(async()=>{jest.spyOn(window.localStorage.__proto__,"getItem"),window.localStorage.__proto__.getItem=jest.fn(),getSessionId("asdf",{},""),expect(localStorage.getItem).toHaveBeenCalled()}))}))}));