import { fund, getCurrentPointerPool } from "../../../src/fund/mod"; import { forceFundmeOnBrowser } from "../../../src/fund/fund-browser"; import { toBeInTheDocument, toHaveAttribute } from "@testing-library/jest-dom/matchers"; import { scriptFundmeIsNotApplicationJson } from "../../../src/fund/errors"; expect.extend({ toBeInTheDocument, toHaveAttribute }); describe("parsing fundme template from a JSON array", () => { test('fund() will scrape from `; forceFundmeOnBrowser(); fund(); const pool = getCurrentPointerPool(); // @ts-ignore expect(pool[0].address).toBe("$coil.xrptipbot.com/my-pointer"); document.body.innerHTML = ""; }); test(" `; forceFundmeOnBrowser(); fund(); const pool = getCurrentPointerPool(); // @ts-ignore expect(pool[0].address).toBe("$coil.xrptipbot.com/my-pointer"); document.body.innerHTML = ""; }); test(' `; forceFundmeOnBrowser(); // @ts-ignore expect(() => fund()).toThrowError(scriptFundmeIsNotApplicationJson); document.body.innerHTML = ""; }); });