mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
committed by
Aaron Bohy
parent
5911c8e3f6
commit
2aa705f5c8
@@ -52,6 +52,15 @@ describe("router miscellaneous", () => {
|
||||
expect(window.location.hash).toBe("#/users/5");
|
||||
expect(env.qweb.forceUpdate).toHaveBeenCalledTimes(2);
|
||||
});
|
||||
|
||||
test("navigate in hash mode preserve location", async () => {
|
||||
router = new TestRouter(env, [{ name: "users", path: "/users/{{id}}" }], {mode: "hash"});
|
||||
window.history.pushState({}, "title", window.location.origin + '/test.html');
|
||||
expect(window.location.href).toBe("http://localhost/test.html");
|
||||
await router.navigate({ to: "users", params: { id: 3 } });
|
||||
expect(window.location.href).toBe("http://localhost/test.html#/users/3");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe("routeToPath", () => {
|
||||
|
||||
Reference in New Issue
Block a user