Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Fix type and test
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Henneke <dominik.henneke@nordeck.net>
  • Loading branch information
dhenneke committed May 8, 2023
1 parent b0fb146 commit 3d536dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/stores/widgets/StopGapWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export class StopGapWidget extends EventEmitter {
clientId: ELEMENT_CLIENT_ID,
clientTheme: SettingsStore.getValue("theme"),
clientLanguage: getUserLanguage(),
deviceId: this.client.getDeviceId(),
deviceId: this.client.getDeviceId() ?? undefined,
};
const templated = this.mockWidget.getCompleteUrl(Object.assign(defaults, fromCustomisation), opts?.asPopout);

Expand Down
5 changes: 3 additions & 2 deletions test/stores/widgets/StopGapWidget-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ limitations under the License.
*/

import { mocked, MockedObject } from "jest-mock";
import { last } from "lodash";
import { MatrixEvent } from "matrix-js-sdk/src/matrix";
import { MatrixClient, ClientEvent } from "matrix-js-sdk/src/client";
import { ClientWidgetApi } from "matrix-widget-api";
Expand Down Expand Up @@ -42,7 +43,7 @@ describe("StopGapWidget", () => {
id: "test",
creatorUserId: "@alice:example.org",
type: "example",
url: "https://example.org?user-id=$matrix_user_id&device-id=$org.matrix.msc3819.device_id",
url: "https://example.org?user-id=$matrix_user_id&device-id=$org.matrix.msc3819.matrix_device_id",
roomId: "!1:example.org",
},
room: mkRoom(client, "!1:example.org"),
Expand All @@ -53,7 +54,7 @@ describe("StopGapWidget", () => {
});
// Start messaging without an iframe, since ClientWidgetApi is mocked
widget.startMessaging(null as unknown as HTMLIFrameElement);
messaging = mocked(mocked(ClientWidgetApi).mock.instances[0]);
messaging = mocked(last(mocked(ClientWidgetApi).mock.instances)!);
});

afterEach(() => {
Expand Down

0 comments on commit 3d536dd

Please sign in to comment.