mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
add basic support for mobile mode
This commit is contained in:
@@ -2,7 +2,8 @@ import {
|
||||
escape,
|
||||
htmlTrim,
|
||||
idGenerator,
|
||||
memoize
|
||||
memoize,
|
||||
debounce
|
||||
} from "../../src/ts/core/utils";
|
||||
|
||||
describe("escape", () => {
|
||||
@@ -59,3 +60,20 @@ describe("memoize", () => {
|
||||
expect(nCalls).toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe("debounce", () => {
|
||||
test("works as expected", () => {
|
||||
jest.useFakeTimers();
|
||||
let n = 0;
|
||||
let f = debounce(() => n++, 100);
|
||||
expect(n).toBe(0);
|
||||
f();
|
||||
expect(n).toBe(0);
|
||||
f();
|
||||
expect(n).toBe(0);
|
||||
jest.advanceTimersByTime(90);
|
||||
expect(n).toBe(0);
|
||||
jest.advanceTimersByTime(20);
|
||||
expect(n).toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user