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

Commit

Permalink
fix import and ts errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Alun Turner committed Jun 16, 2023
1 parent be7745b commit 30b4352
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ limitations under the License.
*/

import { KeyboardEvent, RefObject, SyntheticEvent, useCallback, useRef, useState } from "react";
import { MappedSuggestion } from "@matrix-org/matrix-wysiwyg";
import { AllowedMentionAttributes, IEventRelation } from "matrix-js-sdk/src/matrix";
import { AllowedMentionAttributes, MappedSuggestion } from "@matrix-org/matrix-wysiwyg";
import { IEventRelation } from "matrix-js-sdk/src/matrix";

import { useSettingValue } from "../../../../../hooks/useSettings";
import { IS_MAC, Key } from "../../../../../Keyboard";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe("processMention", () => {
it("returns early when suggestion is null", () => {
const mockSetSuggestion = jest.fn();
const mockSetText = jest.fn();
processMention("href", "displayName", {}, null, mockSetSuggestion, mockSetText);
processMention("href", "displayName", new Map(), null, mockSetSuggestion, mockSetText);

expect(mockSetSuggestion).not.toHaveBeenCalled();
expect(mockSetText).not.toHaveBeenCalled();
Expand All @@ -95,7 +95,7 @@ describe("processMention", () => {
processMention(
href,
displayName,
{ "data-test-attribute": "test" },
new Map([["style", "test"]]),
{ node: textNode, startOffset: 0, endOffset: 2 } as unknown as Suggestion,
mockSetSuggestionData,
mockSetText,
Expand All @@ -109,7 +109,7 @@ describe("processMention", () => {
expect(linkElement).toBeInstanceOf(HTMLAnchorElement);
expect(linkElement).toHaveAttribute(href, href);
expect(linkElement).toHaveAttribute("contenteditable", "false");
expect(linkElement).toHaveAttribute("data-test-attribute", "test");
expect(linkElement).toHaveAttribute("style", "test");
expect(linkElement.textContent).toBe(displayName);

expect(mockSetText).toHaveBeenCalledWith();
Expand Down

0 comments on commit 30b4352

Please sign in to comment.