Skip to content

Commit 7c595cf

Browse files
committed
Fix code style issues
1 parent dbc3c3b commit 7c595cf

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

src/extensions/UserSearchExtensions.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,11 @@ interface RequestOptsProjection extends Pick<RequestInit, "priority"> {
7676
}
7777

7878
/*
79-
* A interface providing a slice/projection of the SdkContextClass in matrix-react-sdk
80-
*/
79+
* A interface providing a slice/projection of the SdkContextClass in matrix-react-sdk
80+
*/
8181
export interface SdkContextClassProjection {
82-
8382
get roomViewStore(): RoomViewStoreProjection;
84-
get spaceStore(): SpaceStoreClassProjection;
83+
get spaceStore(): SpaceStoreClassProjection;
8584
}
8685

8786
/**
@@ -100,10 +99,10 @@ export abstract class UserSearchExtensionsBase implements ProvideUserSearchExten
10099

101100
/**
102101
* Search context used to augment call to /user-directory/search
103-
*
102+
*
104103
*/
105104
export interface SearchContext {
106-
extraBodyArgs: {[key: string]: string}|null;
105+
extraBodyArgs: { [key: string]: string } | null;
107106
extraRequestOptions: RequestOptsProjection;
108107
}
109108

@@ -114,7 +113,6 @@ export interface SearchContext {
114113
*
115114
* */
116115
export class DefaultUserSearchExtensions extends UserSearchExtensionsBase {
117-
118116
public async getSearchContext(client: any, sdkContext: SdkContextClassProjection): Promise<SearchContext> {
119117
console.log("Default resolveSearchContext()");
120118
return {

test/extensions/UserSearchExtensions.test.tsx

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,20 @@ describe("Custom UserSearchExtensions", () => {
7474

7575
this.extensions = {
7676
userSearch: new (class extends UserSearchExtensionsBase {
77-
public async getSearchContext(client: any, sdkContextClass: SdkContextClassProjection): Promise<SearchContext> {
77+
public async getSearchContext(
78+
client: any,
79+
sdkContextClass: SdkContextClassProjection,
80+
): Promise<SearchContext> {
7881
return {
7982
extraBodyArgs: {
80-
tenant_id: "my_tenant_id"
83+
tenant_id: "my_tenant_id",
8184
},
8285
extraRequestOptions: {
8386
headers: {
84-
"custom-header": "custom-header-value"
85-
}
87+
"custom-header": "custom-header-value",
88+
},
8689
},
87-
};
90+
};
8891
}
8992
})(),
9093
};
@@ -96,18 +99,18 @@ describe("Custom UserSearchExtensions", () => {
9699
let result = await module.extensions!.userSearch?.getSearchContext(null, {
97100
roomViewStore: {
98101
getRoomId(): Optional<string> {
99-
return "#room1:example.org";
100-
}
102+
return "#room1:example.org";
103+
},
101104
},
102105
spaceStore: {
103106
get activeSpaceRoom(): RoomProjection | null {
104107
return {
105108
roomId: "#space:example.org",
106109
};
107-
}
108-
}
110+
},
111+
},
109112
});
110-
expect(result?.extraBodyArgs!.tenant_id).toBe("my_tenant_id")
111-
expect(result?.extraRequestOptions!.headers!["custom-header"]).toBe("custom-header-value")
113+
expect(result?.extraBodyArgs!.tenant_id).toBe("my_tenant_id");
114+
expect(result?.extraRequestOptions!.headers!["custom-header"]).toBe("custom-header-value");
112115
});
113116
});

0 commit comments

Comments
 (0)