mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
preliminary support for home menu
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Env } from "../../src/ts/env";
|
||||
import { Navbar } from "../../src/ts/widgets/navbar";
|
||||
import { Navbar, Props } from "../../src/ts/widgets/navbar";
|
||||
import { makeTestEnv, makeTestFixture } from "../helpers";
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -8,10 +8,12 @@ import { makeTestEnv, makeTestFixture } from "../helpers";
|
||||
|
||||
let fixture: HTMLElement;
|
||||
let env: Env;
|
||||
let props: Props;
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = makeTestFixture();
|
||||
env = makeTestEnv();
|
||||
props = { inMenu: false, toggleHomeMenu: () => {} };
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@@ -23,21 +25,21 @@ afterEach(() => {
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
test("can be rendered", async () => {
|
||||
const navbar = new Navbar(env);
|
||||
const navbar = new Navbar(env, props);
|
||||
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);
|
||||
const navbar = new Navbar(env, props);
|
||||
await navbar.mount(fixture);
|
||||
expect(fixture.innerHTML).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test("mobile mode: navbar is different", async () => {
|
||||
env.isMobile = true;
|
||||
const navbar = new Navbar(env);
|
||||
const navbar = new Navbar(env, props);
|
||||
await navbar.mount(fixture);
|
||||
expect(fixture.innerHTML).toMatchSnapshot();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user