mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
37 lines
1.0 KiB
TypeScript
37 lines
1.0 KiB
TypeScript
import { Env } from "../../src/ts/env";
|
|
import { Navbar } from "../../src/ts/widgets/navbar";
|
|
import { makeTestEnv, makeTestFixture } from "../helpers";
|
|
|
|
//------------------------------------------------------------------------------
|
|
// Setup and helpers
|
|
//------------------------------------------------------------------------------
|
|
|
|
let fixture: HTMLElement;
|
|
let env: Env;
|
|
|
|
beforeEach(() => {
|
|
fixture = makeTestFixture();
|
|
env = makeTestEnv();
|
|
});
|
|
|
|
afterEach(() => {
|
|
fixture.remove();
|
|
});
|
|
|
|
//------------------------------------------------------------------------------
|
|
// Tests
|
|
//------------------------------------------------------------------------------
|
|
|
|
test("can be rendered", async () => {
|
|
const navbar = new Navbar(env);
|
|
await navbar.mount(fixture);
|
|
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(fixture.innerHTML).toMatchSnapshot();
|
|
});
|