From 30b43529bc7a5ca2bf1c8c0e07cf3b55b21e145d Mon Sep 17 00:00:00 2001 From: Alun Turner Date: Fri, 16 Jun 2023 16:41:22 +0100 Subject: [PATCH] fix import and ts errors --- .../rooms/wysiwyg_composer/hooks/usePlainTextListeners.ts | 4 ++-- .../rooms/wysiwyg_composer/hooks/useSuggestion-test.tsx | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/views/rooms/wysiwyg_composer/hooks/usePlainTextListeners.ts b/src/components/views/rooms/wysiwyg_composer/hooks/usePlainTextListeners.ts index 9f85546b542..39d13288111 100644 --- a/src/components/views/rooms/wysiwyg_composer/hooks/usePlainTextListeners.ts +++ b/src/components/views/rooms/wysiwyg_composer/hooks/usePlainTextListeners.ts @@ -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"; diff --git a/test/components/views/rooms/wysiwyg_composer/hooks/useSuggestion-test.tsx b/test/components/views/rooms/wysiwyg_composer/hooks/useSuggestion-test.tsx index 11f545ffda4..1ee3ac72f45 100644 --- a/test/components/views/rooms/wysiwyg_composer/hooks/useSuggestion-test.tsx +++ b/test/components/views/rooms/wysiwyg_composer/hooks/useSuggestion-test.tsx @@ -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(); @@ -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, @@ -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();