Files
owl/tests/qweb/qweb_memory.test.ts
T
Mathieu Duckerts-Antoine ba32772a92 [FIX] qweb: re-add test on memory leak
Re-add test from 6e185f9.
2021-10-20 15:16:26 +02:00

13 lines
488 B
TypeScript

import { renderToString, snapshotEverything } from "../helpers";
snapshotEverything();
describe("memory", () => {
test("t-foreach does not leak stuff in global scope", () => {
const initialNumberOfGlobals = Object.keys(window).length;
const template = `<p><t t-foreach="[3, 2, 1]" t-as="item" t-key="item_index"><t t-esc="item"/></t></p>`;
expect(renderToString(template)).toBe("<p>321</p>");
expect(Object.keys(window).length).toBe(initialNumberOfGlobals);
});
});