diff --git a/spec/useLoadClientScript.spec.tsx b/spec/useLoadClientScript.spec.tsx index 8bd4191..df57c10 100644 --- a/spec/useLoadClientScript.spec.tsx +++ b/spec/useLoadClientScript.spec.tsx @@ -3,7 +3,7 @@ import { renderHook } from "@testing-library/react" import { useLoadClientScript } from "../src/hooks/useLoadClientScript" import scriptLoader from "../src/hooks/scriptLoader" import "@testing-library/jest-dom/vitest" -import { getNostoWindow, isNostoLoaded, reloadNostoWindow } from "@nosto/nosto-js" +import { getNostoWindow, isNostoLoaded, reloadNosto } from "@nosto/nosto-js" function loadClientScript(merchant: string) { const script = document.createElement("script") @@ -13,7 +13,7 @@ function loadClientScript(merchant: string) { script.async = true const promise = new Promise(resolve => { script.onload = () => { - reloadNostoWindow({ site: "localhost" }) + reloadNosto({ site: "localhost" }) resolve() } }) diff --git a/src/hooks/useLoadClientScript.ts b/src/hooks/useLoadClientScript.ts index 6542cfe..e0bfc7e 100644 --- a/src/hooks/useLoadClientScript.ts +++ b/src/hooks/useLoadClientScript.ts @@ -1,7 +1,7 @@ import { useState, useEffect } from "react" import type { NostoProviderProps } from "../components/NostoProvider" import scriptLoaderFn from "./scriptLoader" -import { init, initNostoStub, isNostoLoaded, nostojs, reloadNostoWindow } from "@nosto/nosto-js" +import { init, initNostoStub, isNostoLoaded, nostojs, reloadNosto } from "@nosto/nosto-js" type NostoScriptProps = Pick @@ -19,7 +19,7 @@ export function useLoadClientScript(props: NostoScriptProps) { function scriptOnload() { // Override for production scripts to work in unit tests if ("nostoReactTest" in window) { - reloadNostoWindow({ + reloadNosto({ site: "localhost" }) }