mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
rename web into demo
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
import { Registry } from "../../src/ts/core/registry";
|
||||
import { makeTestEnv } from "../helpers";
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Tests
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
test("does not reload action if already done", async () => {
|
||||
const routes: string[] = [];
|
||||
const testEnv = makeTestEnv({
|
||||
mockRPC(route, params) {
|
||||
routes.push(route);
|
||||
return this.rpc(route, params);
|
||||
}
|
||||
});
|
||||
|
||||
expect(routes).toEqual([]);
|
||||
|
||||
testEnv.store.doAction(131);
|
||||
|
||||
expect(routes).toEqual(["web/action/load"]);
|
||||
|
||||
testEnv.store.doAction(131);
|
||||
|
||||
expect(routes).toEqual(["web/action/load"]);
|
||||
});
|
||||
|
||||
test("display a warning if client action is not in registry", async () => {
|
||||
const testEnv = makeTestEnv({ actionRegistry: new Registry() });
|
||||
|
||||
await testEnv.store.doAction(131);
|
||||
|
||||
const notifs = testEnv.store.state.notifications;
|
||||
expect(notifs.length).toBe(1);
|
||||
expect(notifs[0].type).toBe("warning");
|
||||
});
|
||||
|
||||
test("display a warning if view is not in registry", async () => {
|
||||
const testEnv = makeTestEnv({ viewRegistry: new Registry() });
|
||||
|
||||
await testEnv.store.doAction(250);
|
||||
|
||||
const notifs = testEnv.store.state.notifications;
|
||||
expect(notifs.length).toBe(1);
|
||||
expect(notifs[0].type).toBe("warning");
|
||||
});
|
||||
Reference in New Issue
Block a user