mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
imp: work on store, refactor, improve todoapp
This commit is contained in:
+13
-1
@@ -4,7 +4,8 @@ import {
|
||||
idGenerator,
|
||||
memoize,
|
||||
debounce,
|
||||
findInTree
|
||||
findInTree,
|
||||
shallowEqual
|
||||
} from "../src/utils";
|
||||
|
||||
describe("escape", () => {
|
||||
@@ -91,3 +92,14 @@ describe("findInTree", () => {
|
||||
expect(match2).toBe(null);
|
||||
});
|
||||
});
|
||||
|
||||
describe("shallowEqual", () => {
|
||||
test("simple comparisons", () => {
|
||||
const obj1 = {};
|
||||
expect(shallowEqual(obj1, obj1)).toBe(true);
|
||||
expect(shallowEqual({}, {})).toBe(true);
|
||||
expect(shallowEqual({ a: 1 }, {})).toBe(false);
|
||||
expect(shallowEqual({ a: 1 }, { a: 1 })).toBe(true);
|
||||
expect(shallowEqual({ a: 1 }, ["a"])).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user