mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
test utils refactoring
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { Callback } from "../../src/ts/core/event_bus";
|
||||
import { IRouter, Query, RouterEvent } from "../../src/ts/services/router";
|
||||
|
||||
export class MockRouter implements IRouter {
|
||||
currentQuery: Query;
|
||||
|
||||
constructor(query: Query = {}) {
|
||||
this.currentQuery = query;
|
||||
}
|
||||
|
||||
navigate(query: Query) {
|
||||
this.currentQuery = query;
|
||||
}
|
||||
on(event: RouterEvent, owner: any, callback: Callback) {}
|
||||
getQuery(): Query {
|
||||
return this.currentQuery;
|
||||
}
|
||||
|
||||
formatURL(path: string, query: Query): string {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user