mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
use snapshot testing
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Env } from "../../src/ts/env";
|
||||
import { makeTestEnv, makeTestFixture, normalize } from "../helpers";
|
||||
import { Navbar } from "../../src/ts/widgets/navbar";
|
||||
import { makeTestEnv, makeTestFixture } from "../helpers";
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Setup and helpers
|
||||
@@ -25,26 +25,12 @@ afterEach(() => {
|
||||
test("can be rendered", async () => {
|
||||
const navbar = new Navbar(env);
|
||||
await navbar.mount(fixture);
|
||||
expect(normalize(fixture.innerHTML)).toBe(
|
||||
normalize(`
|
||||
<div class=\"o_navbar\">
|
||||
<span class=\"title\">Odoo</span>
|
||||
<ul></ul>
|
||||
</div>`)
|
||||
);
|
||||
expect(fixture.innerHTML).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test("can render one menu item", async () => {
|
||||
env.menus.push({ title: "menu", actionID: 4 });
|
||||
const navbar = new Navbar(env);
|
||||
await navbar.mount(fixture);
|
||||
expect(normalize(fixture.innerHTML)).toBe(
|
||||
normalize(`
|
||||
<div class=\"o_navbar\">
|
||||
<span class=\"title\">Odoo</span>
|
||||
<ul>
|
||||
<li><ahref=\"\">menu</a></li>
|
||||
</ul>
|
||||
</div>`)
|
||||
);
|
||||
expect(fixture.innerHTML).toMatchSnapshot();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user