mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import { Env, makeEnv } from "../../src/ts/env";
|
|
import { Store } from "../../src/ts/store/store";
|
|
import { HomeMenu, Props } from "../../src/ts/ui/home_menu";
|
|
import * as helpers from "../helpers";
|
|
|
|
//------------------------------------------------------------------------------
|
|
// Setup and helpers
|
|
//------------------------------------------------------------------------------
|
|
|
|
let fixture: HTMLElement;
|
|
let store: Store;
|
|
let env: Env;
|
|
let props: Props;
|
|
let templates: string;
|
|
|
|
beforeAll(async () => {
|
|
templates = await helpers.loadTemplates();
|
|
});
|
|
|
|
beforeEach(() => {
|
|
fixture = helpers.makeTestFixture();
|
|
store = helpers.makeTestStore();
|
|
env = makeEnv(store, templates);
|
|
props = { menuInfo: helpers.makeDemoMenuInfo() };
|
|
});
|
|
|
|
afterEach(() => {
|
|
fixture.remove();
|
|
});
|
|
|
|
//------------------------------------------------------------------------------
|
|
// Tests
|
|
//------------------------------------------------------------------------------
|
|
|
|
test("can be rendered", async () => {
|
|
const homeMenu = new HomeMenu(env, props);
|
|
await homeMenu.mount(fixture);
|
|
expect(fixture.innerHTML).toMatchSnapshot();
|
|
});
|