mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-11 07:06:31 +02:00
Write tests
This commit is contained in:
parent
f4e8e79af8
commit
6dc1431270
@ -37,5 +37,25 @@ describe("NavigationApi", () => {
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it("should dispatch correct action on openRoom", () => {
|
||||
const spy = jest.spyOn(defaultDispatcher, "dispatch");
|
||||
// Non alias
|
||||
api.openRoom("!foo:m.org");
|
||||
expect(spy).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
action: "view_room",
|
||||
room_id: "!foo:m.org",
|
||||
}),
|
||||
);
|
||||
// Alias
|
||||
api.openRoom("#bar:m.org");
|
||||
expect(spy).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
action: "view_room",
|
||||
room_alias: "#bar:m.org",
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user