[REM] utils: remove findInTree and htmlTrim

They were not used and are not in the scope of this project.
This commit is contained in:
Géry Debongnie
2019-04-27 11:44:37 +02:00
parent b08e876136
commit 1701d5aa86
2 changed files with 0 additions and 69 deletions
-29
View File
@@ -1,9 +1,7 @@
import {
escape,
htmlTrim,
memoize,
debounce,
findInTree,
patch,
unpatch
} from "../src/utils";
@@ -20,20 +18,6 @@ describe("escape", () => {
});
});
describe("htmlTrim", () => {
test("basic use", () => {
expect(htmlTrim("abc")).toBe("abc");
expect(htmlTrim(" abc")).toBe(" abc");
expect(htmlTrim("abc ")).toBe("abc ");
expect(htmlTrim(" abc ")).toBe(" abc ");
expect(htmlTrim("abc\n ")).toBe("abc ");
expect(htmlTrim("\n ")).toBe(" ");
expect(htmlTrim(" \n ")).toBe(" ");
expect(htmlTrim(" ")).toBe(" ");
expect(htmlTrim("")).toBe("");
});
});
describe("memoize", () => {
test("return correct value", () => {
const f = memoize((a, b) => a + b);
@@ -71,19 +55,6 @@ describe("debounce", () => {
});
});
describe("findInTree", () => {
test("can find stuff in tree", () => {
let tree = {
id: 1,
children: [{ id: 2, children: [] }, { id: 3, key: "hello", children: [] }]
};
const match1 = findInTree(tree, t => t.id === 3);
expect((<any>match1).key).toBe("hello");
const match2 = findInTree(tree, t => t.id === 4);
expect(match2).toBe(null);
});
});
describe("patch/unpatch", () => {
test("can monkey patch a class", () => {
class Test {