display empty action when invalid tag for client action

This commit is contained in:
Géry Debongnie
2019-03-06 09:56:39 +01:00
parent 859e29a7ac
commit 9dffcf4cf6
4 changed files with 54 additions and 7 deletions
+15
View File
@@ -1,6 +1,7 @@
import { Root } from "../../src/ts/ui/root";
import * as helpers from "../helpers";
import { makeTestData, makeTestEnv } from "../helpers";
import { Registry } from "../../src/ts/core/registry";
//------------------------------------------------------------------------------
// Setup and helpers
@@ -61,3 +62,17 @@ test("start with no action => clicks on client action => discuss is rendered", a
menu_id: "96"
});
});
test("clicks on client action with invalid key => empty widget is rendered + warning", async () => {
const data = await makeTestData();
data.actionRegistry = new Registry();
const testEnv = makeTestEnv(data);
const root = new Root(testEnv, testEnv.store);
await root.mount(fixture);
// discuss menu item
await (<any>document.querySelector('[data-menu="96"]')).click();
await helpers.nextTick();
expect(fixture.innerHTML).toMatchSnapshot();
});