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:
@@ -2,7 +2,7 @@
|
||||
|
||||
exports[`can be rendered 1`] = `
|
||||
"<div class=\\"o_navbar\\">
|
||||
<span class=\\"title\\">Odoo</span>
|
||||
<a aria-label=\\"Applications\\" class=\\"o_title fa fa-th\\" href=\\"#\\" title=\\"Applications\\" accesskey=\\"h\\"></a>
|
||||
<ul>
|
||||
|
||||
</ul>
|
||||
@@ -11,7 +11,7 @@ exports[`can be rendered 1`] = `
|
||||
|
||||
exports[`can render one menu item 1`] = `
|
||||
"<div class=\\"o_navbar\\">
|
||||
<span class=\\"title\\">Odoo</span>
|
||||
<a aria-label=\\"Applications\\" class=\\"o_title fa fa-th\\" href=\\"#\\" title=\\"Applications\\" accesskey=\\"h\\"></a>
|
||||
<ul>
|
||||
<li>
|
||||
<a href=\\"\\">
|
||||
@@ -24,7 +24,7 @@ exports[`can render one menu item 1`] = `
|
||||
|
||||
exports[`mobile mode: navbar is different 1`] = `
|
||||
"<div class=\\"o_navbar\\">
|
||||
<span class=\\"title\\">Odoo MOBILE</span>
|
||||
<a aria-label=\\"Applications\\" class=\\"o_title fa fa-th\\" href=\\"#\\" title=\\"Applications\\" accesskey=\\"h\\"></a>
|
||||
<ul>
|
||||
|
||||
</ul>
|
||||
|
||||
@@ -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