diff --git a/src/js_tests/wirecloud/ioSpec.js b/src/js_tests/wirecloud/ioSpec.js index 0a28e51868..656a3197f6 100644 --- a/src/js_tests/wirecloud/ioSpec.js +++ b/src/js_tests/wirecloud/ioSpec.js @@ -72,6 +72,26 @@ .toBe(original.toString()); }); + it("should ignore the supportAccessControl option if using the forceProxy option", function () { + var original = "http://server:1234/path?q=1"; + var expected = "https://wirecloud.example.com/cdp/http/server:1234/path?q=1"; + + expect(Wirecloud.io.buildProxyURL(original, { + supportsAccessControl: true, + forceProxy: true + })).toBe(expected); + }); + + it("should ignore the supportAccessControl option if using the forceProxy option (using URL instances)", function () { + var original = new URL("http://server:1234/path?q=1"); + var expected = "https://wirecloud.example.com/cdp/http/server:1234/path?q=1"; + + expect(Wirecloud.io.buildProxyURL(original, { + supportsAccessControl: true, + forceProxy: true + })).toBe(expected); + }); + it("should support the parameters option (using URL instances)", function () { var original = new URL("http://server:1234/path"); var expected = "https://wirecloud.example.com/cdp/http/server:1234/path?e=1&b=c";