Add tests for each service
This commit is contained in:
parent
8e6d206c8d
commit
30b9cf9c4e
|
@ -0,0 +1,10 @@
|
|||
"use strict";
|
||||
|
||||
import helper from "../assets/javascripts/helpers/google-maps";
|
||||
const instances = helper.redirects;
|
||||
|
||||
describe("Helper", () => {
|
||||
test("There is at least 1 redirect instance in the config", () => {
|
||||
expect(instances.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
|
@ -0,0 +1,30 @@
|
|||
"use strict";
|
||||
|
||||
import helper from "../assets/javascripts/helpers/google-search";
|
||||
const instances = helper.redirects;
|
||||
|
||||
describe("Helper", () => {
|
||||
const instanceObjectKeys = ["link", "q"];
|
||||
|
||||
test("There is at least 1 redirect instance in the config", () => {
|
||||
expect(instances.length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
test("Each entry has all object keys", () => {
|
||||
// for readability: `every` instead of short-circuit `some`
|
||||
const hasAllKeys = instances.every((instance) =>
|
||||
instanceObjectKeys.every((key) => instance.hasOwnProperty(key))
|
||||
);
|
||||
|
||||
expect(hasAllKeys).toBeTruthy();
|
||||
});
|
||||
|
||||
test("Each entry has all object values", () => {
|
||||
// for readability: `every` instead of short-circuit `some`
|
||||
const hasAllValues = instances.every((instance) =>
|
||||
instanceObjectKeys.every((key) => instance[key])
|
||||
);
|
||||
|
||||
expect(hasAllValues).toBeTruthy();
|
||||
});
|
||||
});
|
|
@ -0,0 +1,10 @@
|
|||
"use strict";
|
||||
|
||||
import helper from "../assets/javascripts/helpers/google-translate";
|
||||
const instances = helper.redirects;
|
||||
|
||||
describe("Helper", () => {
|
||||
test("There is at least 1 redirect instance in the config", () => {
|
||||
expect(instances.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
|
@ -0,0 +1,10 @@
|
|||
"use strict";
|
||||
|
||||
import helper from "../assets/javascripts/helpers/instagram";
|
||||
const instances = helper.redirects;
|
||||
|
||||
describe("Helper", () => {
|
||||
test("There is at least 1 redirect instance in the config", () => {
|
||||
expect(instances.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
|
@ -0,0 +1,10 @@
|
|||
"use strict";
|
||||
|
||||
import helper from "../assets/javascripts/helpers/reddit";
|
||||
const instances = helper.redirects;
|
||||
|
||||
describe("Helper", () => {
|
||||
test("There is at least 1 redirect instance in the config", () => {
|
||||
expect(instances.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
|
@ -0,0 +1,10 @@
|
|||
"use strict";
|
||||
|
||||
import helper from "../assets/javascripts/helpers/twitter";
|
||||
const instances = helper.redirects;
|
||||
|
||||
describe("Helper", () => {
|
||||
test("There is at least 1 redirect instance in the config", () => {
|
||||
expect(instances.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
|
@ -0,0 +1,10 @@
|
|||
"use strict";
|
||||
|
||||
import helper from "../assets/javascripts/helpers/wikipedia";
|
||||
const instances = helper.redirects;
|
||||
|
||||
describe("Helper", () => {
|
||||
test("There is at least 1 redirect instance in the config", () => {
|
||||
expect(instances.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
|
@ -0,0 +1,10 @@
|
|||
"use strict";
|
||||
|
||||
import helper from "../assets/javascripts/helpers/youtube";
|
||||
const instances = helper.redirects;
|
||||
|
||||
describe("Helper", () => {
|
||||
test("There is at least 1 redirect instance in the config", () => {
|
||||
expect(instances.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue