diff --git a/packages/shared-components/src/@types/global.d.ts b/packages/shared-components/src/@types/global.d.ts index 5a5e216cd8f..5ba765299b8 100644 --- a/packages/shared-components/src/@types/global.d.ts +++ b/packages/shared-components/src/@types/global.d.ts @@ -13,9 +13,3 @@ declare module "*.md?raw" { const content: string; export default content; } - -// For importing PNGs for use in testing -declare module "*.png" { - const content: string; - export default content; -} diff --git a/packages/shared-components/src/room/timeline/event-tile/body/MImageBodyView/ImageBodyView.stories.tsx b/packages/shared-components/src/room/timeline/event-tile/body/MImageBodyView/ImageBodyView.stories.tsx index 3b6c66cf38a..f3b717ecf0e 100644 --- a/packages/shared-components/src/room/timeline/event-tile/body/MImageBodyView/ImageBodyView.stories.tsx +++ b/packages/shared-components/src/room/timeline/event-tile/body/MImageBodyView/ImageBodyView.stories.tsx @@ -18,10 +18,9 @@ import { type ImageBodyViewActions, type ImageBodyViewSnapshot, } from "./ImageBodyView"; - -const imageSrc = new URL("../../../../../../static/image-body/install-spinner.png", import.meta.url).href; -const thumbnailSrc = new URL("../../../../../../static/image-body/install-spinner.png", import.meta.url).href; -const animatedGifSrc = new URL("../../../../../../static/image-body/install-spinner.gif", import.meta.url).href; +import imageSrc from "../../../../../../static/image-body/install-spinner.png"; +import thumbnailSrc from "../../../../../../static/image-body/install-spinner.png"; +import animatedGifSrc from "../../../../../../static/image-body/install-spinner.gif"; const demoBlurhash = "LEHV6nWB2yk8pyo0adR*.7kCMdnj"; const imageBodyViewStateOptions = [ImageBodyViewState.ERROR, ImageBodyViewState.HIDDEN, ImageBodyViewState.READY]; const imageBodyViewPlaceholderOptions = [ diff --git a/packages/shared-components/src/room/timeline/event-tile/body/MImageBodyView/__snapshots__/ImageBodyView.test.tsx.snap b/packages/shared-components/src/room/timeline/event-tile/body/MImageBodyView/__snapshots__/ImageBodyView.test.tsx.snap index 4b5f47340c8..1c047b6a3aa 100644 --- a/packages/shared-components/src/room/timeline/event-tile/body/MImageBodyView/__snapshots__/ImageBodyView.test.tsx.snap +++ b/packages/shared-components/src/room/timeline/event-tile/body/MImageBodyView/__snapshots__/ImageBodyView.test.tsx.snap @@ -7,7 +7,7 @@ exports[`ImageBodyView > matches snapshot for animated-preview story 1`] = ` >
matches snapshot for animated-preview story 1`] = ` Element logo

matches snapshot for default story 1`] = ` >

matches snapshot for default story 1`] = ` Element logo
@@ -147,7 +147,7 @@ exports[`ImageBodyView > matches snapshot for loading-with-blurhash story 1`] = >
matches snapshot for loading-with-blurhash story 1`] = Element logo
@@ -192,7 +192,7 @@ exports[`ImageBodyView > matches snapshot for loading-with-spinner story 1`] = ` >
matches snapshot for loading-with-spinner story 1`] = ` Element logo
diff --git a/packages/shared-components/src/room/timeline/event-tile/body/MVideoBodyView/VideoBodyView.stories.tsx b/packages/shared-components/src/room/timeline/event-tile/body/MVideoBodyView/VideoBodyView.stories.tsx index 115d93e5cae..81366f174e6 100644 --- a/packages/shared-components/src/room/timeline/event-tile/body/MVideoBodyView/VideoBodyView.stories.tsx +++ b/packages/shared-components/src/room/timeline/event-tile/body/MVideoBodyView/VideoBodyView.stories.tsx @@ -17,8 +17,7 @@ import { } from "./VideoBodyView"; import { useMockedViewModel } from "../../../../../core/viewmodel/useMockedViewModel"; import { withViewDocs } from "../../../../../../.storybook/withViewDocs"; - -const demoVideo = new URL("../../../../../../static/videoBodyDemo.webm", import.meta.url).href; +import demoVideo from "../../../../../../static/videoBodyDemo.webm"; type VideoBodyViewProps = VideoBodyViewSnapshot & VideoBodyViewActions & { diff --git a/packages/shared-components/src/room/timeline/event-tile/body/MVideoBodyView/__snapshots__/VideoBodyView.test.tsx.snap b/packages/shared-components/src/room/timeline/event-tile/body/MVideoBodyView/__snapshots__/VideoBodyView.test.tsx.snap index 57c2fa47d12..f8111582776 100644 --- a/packages/shared-components/src/room/timeline/event-tile/body/MVideoBodyView/__snapshots__/VideoBodyView.test.tsx.snap +++ b/packages/shared-components/src/room/timeline/event-tile/body/MVideoBodyView/__snapshots__/VideoBodyView.test.tsx.snap @@ -79,7 +79,7 @@ exports[`VideoBodyView > matches snapshot for ready story 1`] = ` crossorigin="anonymous" poster="/static/element.png" preload="none" - src="http://localhost:63315/static/videoBodyDemo.webm" + src="/static/videoBodyDemo.webm" />
diff --git a/packages/shared-components/tsconfig.json b/packages/shared-components/tsconfig.json index e959a552c5c..2691b1f20cc 100644 --- a/packages/shared-components/tsconfig.json +++ b/packages/shared-components/tsconfig.json @@ -14,7 +14,7 @@ "declaration": true, "jsx": "react", "lib": ["es2022", "es2024.promise", "dom", "dom.iterable"], - "types": ["storybook-addon-vis/matcher"], + "types": ["vite/client", "storybook-addon-vis/matcher"], "strict": true, "paths": { "@test-utils": ["./src/test/utils/index"]