add action cache to action manager

This commit is contained in:
Géry Debongnie
2019-03-01 11:26:00 +01:00
parent 3a44d41654
commit 470154f8f9
2 changed files with 27 additions and 3 deletions
@@ -0,0 +1,19 @@
import { makeTestStore } from "../helpers";
//------------------------------------------------------------------------------
// Tests
//------------------------------------------------------------------------------
test("does not reload action if already done", async () => {
const routes: string[] = [];
const store = makeTestStore({ rpc: async route => routes.push(route) });
expect(routes).toEqual([]);
store.doAction(32);
expect(routes).toEqual(["web/action/load"]);
store.doAction(32);
expect(routes).toEqual(["web/action/load"]);
});