diff --git a/tests/unit/executors/web-url-executor.test.ts b/tests/unit/executors/web-url-executor.test.ts new file mode 100644 index 000000000..96d4abe7e --- /dev/null +++ b/tests/unit/executors/web-url-executor.test.ts @@ -0,0 +1,35 @@ +import { expect } from "chai"; +import { WebUrlExecutor } from "./../../../src/ts/executors/web-url-executor"; + +describe("windows file path executor", () => { + describe("is valid for execution", () => { + let executor = new WebUrlExecutor(); + + it("should return true when passing in a valid file path", () => { + let validUrls = [ + "https://google.com", + "https://github.com/some-user", + "www.google.com", + "google.com", + "google.com/?query=search-something¶m=gugus" + ]; + + for (let validUrl of validUrls) { + let actual = executor.isValidForExecution(validUrl); + expect(actual).to.be.true; + } + }); + + it("should return false when passing in an invalid file path", () => { + let invalidUrls = [ + "this is some shit", + "/this/is/not/a/url" + ]; + + for (let invalidUrl of invalidUrls) { + let actual = executor.isValidForExecution(invalidUrl); + expect(actual).to.be.false; + } + }); + }); +}); \ No newline at end of file