mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[REF] tests: improve test helpers
- remove snapshotApp - remove addTemplates - simplify helpers - make sure snapshotted templates are snapshotted with the app config
This commit is contained in:
committed by
Samuel Degueldre
parent
f19de73b0f
commit
a727347d60
@@ -3,9 +3,17 @@ import { makeTestFixture, nextTick, snapshotEverything } from "../helpers";
|
||||
|
||||
snapshotEverything();
|
||||
let fixture: HTMLElement;
|
||||
let originalconsoleWarn = console.warn;
|
||||
let mockConsoleWarn: any;
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = makeTestFixture();
|
||||
mockConsoleWarn = jest.fn(() => {});
|
||||
console.warn = mockConsoleWarn;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
console.warn = originalconsoleWarn;
|
||||
});
|
||||
|
||||
describe("style and class handling", () => {
|
||||
@@ -349,5 +357,6 @@ describe("style and class handling", () => {
|
||||
/Cannot read properties of undefined \(reading 'crash'\)|Cannot read property 'crash' of undefined/g;
|
||||
expect(error!.message).toMatch(regexp);
|
||||
expect(fixture.innerHTML).toBe("");
|
||||
expect(mockConsoleWarn).toBeCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user