[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:
Géry Debongnie
2021-12-20 11:19:59 +01:00
committed by Samuel Degueldre
parent f19de73b0f
commit a727347d60
48 changed files with 4157 additions and 3279 deletions
+9
View File
@@ -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);
});
});