Skip to content

Commit

Permalink
Added unit tests for WebUrlExecutor
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverschwendener committed Feb 12, 2018
1 parent d55ebb6 commit f17bb3e
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tests/unit/executors/web-url-executor.test.ts
Original file line number Diff line number Diff line change
@@ -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&param=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;
}
});
});
});

0 comments on commit f17bb3e

Please sign in to comment.