refactoring: widgets -> ui, discuss in subfolder

This commit is contained in:
Géry Debongnie
2019-03-04 14:49:00 +01:00
parent 3a761da764
commit e59b976dcb
20 changed files with 11 additions and 11 deletions
+39
View File
@@ -0,0 +1,39 @@
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();
});