Fix test that doesn't make sense in usePublicRoomDirectory-test.tsx (#29335)
* remove test that doesn't make sense * Actually let's fix the test rather than remove it * Add comment, remove consoles.
This commit is contained in:
@@ -27,17 +27,15 @@ describe("usePublicRoomDirectory", () => {
|
|||||||
cli.getDomain = () => "matrix.org";
|
cli.getDomain = () => "matrix.org";
|
||||||
cli.getThirdpartyProtocols = () => Promise.resolve({});
|
cli.getThirdpartyProtocols = () => Promise.resolve({});
|
||||||
cli.publicRooms = ({ filter }: IRoomDirectoryOptions) => {
|
cli.publicRooms = ({ filter }: IRoomDirectoryOptions) => {
|
||||||
const chunk = filter?.generic_search_term
|
const chunk = [
|
||||||
? [
|
{
|
||||||
{
|
room_id: "hello world!",
|
||||||
room_id: "hello world!",
|
name: filter?.generic_search_term ?? "", // If the query is "" no filter is applied(an is undefined here), in keeping with the pattern let's call the room ""
|
||||||
name: filter.generic_search_term,
|
world_readable: true,
|
||||||
world_readable: true,
|
guest_can_join: true,
|
||||||
guest_can_join: true,
|
num_joined_members: 1,
|
||||||
num_joined_members: 1,
|
},
|
||||||
},
|
];
|
||||||
]
|
|
||||||
: [];
|
|
||||||
return Promise.resolve({
|
return Promise.resolve({
|
||||||
chunk,
|
chunk,
|
||||||
total_room_count_estimate: 1,
|
total_room_count_estimate: 1,
|
||||||
@@ -67,7 +65,7 @@ describe("usePublicRoomDirectory", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should work with empty queries", async () => {
|
it("should work with empty queries", async () => {
|
||||||
const query = "ROOM NAME";
|
const query = "";
|
||||||
const { result } = render();
|
const { result } = render();
|
||||||
|
|
||||||
act(() => {
|
act(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user