Some simple initial tests for MediaView (#2813)

* Some simple tests for MediaView

* Use jest-dom assertions

* Add tests for videoMuted

* Add test case for placeholder video track

* Revert yarn.lock changes

* More revert

* Deduplicate test case logic and improve names

* Use role and label
This commit is contained in:
Hugh Nimmo-Smith
2024-11-25 20:22:02 +00:00
committed by GitHub
parent e36029c9c0
commit cf174261c9
7 changed files with 187 additions and 13 deletions

View File

@@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
Please see LICENSE in the repository root for full details.
*/
import { useMemo, FC } from "react";
import { useMemo, FC, CSSProperties } from "react";
import { Avatar as CompoundAvatar } from "@vector-im/compound-web";
import { getAvatarUrl } from "./utils/matrix";
@@ -33,6 +33,7 @@ interface Props {
className?: string;
src?: string;
size?: Size | number;
style?: CSSProperties;
}
export const Avatar: FC<Props> = ({
@@ -41,6 +42,8 @@ export const Avatar: FC<Props> = ({
name,
src,
size = Size.MD,
style,
...props
}) => {
const { client } = useClient();
@@ -64,6 +67,8 @@ export const Avatar: FC<Props> = ({
name={name}
size={`${sizePx}px`}
src={resolvedSrc}
style={style}
{...props}
/>
);
};