[IMP] improve tests of transition directive

This commit is contained in:
Aaron Bohy
2019-05-10 17:46:32 +02:00
parent c2280ff1bb
commit 649e20b956
6 changed files with 210 additions and 27 deletions
+12 -1
View File
@@ -1,5 +1,5 @@
import { Env } from "../src/component";
import { QWeb } from "../src/qweb_core";
import { QWeb, UTILS } from "../src/qweb_core";
import "../src/qweb_directives";
import "../src/qweb_extensions";
@@ -42,3 +42,14 @@ export function makeTestEnv(): Env {
qweb: new QWeb()
};
}
let nextFrame = UTILS.nextFrame;
export function patchNextFrame(f: Function): void {
UTILS.nextFrame = (cb: () => void) => {
setTimeout(() => f(cb));
};
}
export function unpatchNextFrame(): void {
UTILS.nextFrame = nextFrame;
}