test utils refactoring

This commit is contained in:
Géry Debongnie
2019-03-04 22:47:20 +01:00
parent 8926b8828f
commit a162e40fe0
15 changed files with 494 additions and 394 deletions
+17
View File
@@ -0,0 +1,17 @@
import { TestData } from "./test_data";
export class MockServer {
data: TestData;
constructor(data: TestData) {
this.data = data;
}
rpc(route: string, params: any): Promise<any> {
if (route === "web/action/load") {
const action = this.data.actions.find(a => a.id === params.action_id);
return Promise.resolve(action);
}
return Promise.resolve(true);
}
}