use snapshot testing

This commit is contained in:
Géry Debongnie
2019-01-30 10:22:24 +01:00
parent bc6bf5354f
commit be7ff1faf0
5 changed files with 40 additions and 27 deletions
@@ -1,7 +1,7 @@
import { Env } from "../../src/ts/env";
import { makeTestEnv, makeTestFixture, normalize } from "../helpers";
import { Notification } from "../../src/ts/widgets/notification";
import { INotification } from "../../src/ts/services/notifications";
import { Notification } from "../../src/ts/widgets/notification";
import { makeTestEnv, makeTestFixture } from "../helpers";
//------------------------------------------------------------------------------
// Setup and helpers
@@ -38,13 +38,7 @@ test("can be rendered", async () => {
const notif = makeNotification({ title: "title", message: "message" });
const navbar = new Notification(env, notif);
await navbar.mount(fixture);
expect(normalize(fixture.innerHTML)).toBe(
normalize(`
<div class=\"o_notification\">
<div class=\"o_notification_title\">title</div>
<div class=\"o_notification_content\">message</div>
</div>`)
);
expect(fixture.innerHTML).toMatchSnapshot();
});
test("can be closed by clicking on it (if sticky)", async () => {