"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const appendQueryParamsToDappURL_1 = require("./appendQueryParamsToDappURL");
describe("appendQueryParamsToDappURL", () => {
    it("appends query parameters to a valid dappUrl", () => {
        const manifest = {
            params: {
                dappUrl: "https://example.com/",
            },
        };
        const queryString = {
            param1: "value1",
            param2: ["value2", "value3"],
        };
        const url = (0, appendQueryParamsToDappURL_1.appendQueryParamsToDappURL)(manifest, queryString);
        expect(url).toBeInstanceOf(URL);
        expect(url?.toString()).toEqual("https://example.com/?param1=value1&param2=value2&param2=value3");
    });
    it("returns undefined when there is no valid dappUrl in manifest.params", () => {
        const manifest = {
            params: {
                dappUrl: "invalid-url",
            },
        };
        const queryString = {
            param1: "value1",
            param2: ["value2", "value3"],
        };
        const url = (0, appendQueryParamsToDappURL_1.appendQueryParamsToDappURL)(manifest, queryString);
        expect(url).toBeUndefined();
    });
    it("returns undefined when there is no dappUrl in manifest.params", () => {
        const manifest = {};
        const queryString = {
            param1: "value1",
            param2: ["value2", "value3"],
        };
        const url = (0, appendQueryParamsToDappURL_1.appendQueryParamsToDappURL)(manifest, queryString);
        expect(url).toBeUndefined();
    });
});
//# sourceMappingURL=appendQueryParamsToDappURL.test.js.map