mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[REM] utils: remove findInTree and htmlTrim
They were not used and are not in the scope of this project.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user