mirror of
https://github.com/vector-im/element-call.git
synced 2026-07-30 19:39:22 +00:00
fix tests
This commit is contained in:
@@ -93,7 +93,7 @@ export const InCallFooter: FC<InCallFooterProps> = ({
|
|||||||
key="audio"
|
key="audio"
|
||||||
enabled={audioEnabled}
|
enabled={audioEnabled}
|
||||||
onClick={toggleAudio ?? undefined}
|
onClick={toggleAudio ?? undefined}
|
||||||
disabled={toggleAudio === null}
|
disabled={toggleAudio === undefined}
|
||||||
data-testid="incall_mute"
|
data-testid="incall_mute"
|
||||||
/>,
|
/>,
|
||||||
<VideoButton
|
<VideoButton
|
||||||
@@ -101,7 +101,7 @@ export const InCallFooter: FC<InCallFooterProps> = ({
|
|||||||
key="video"
|
key="video"
|
||||||
enabled={videoEnabled}
|
enabled={videoEnabled}
|
||||||
onClick={toggleVideo ?? undefined}
|
onClick={toggleVideo ?? undefined}
|
||||||
disabled={toggleVideo === null}
|
disabled={toggleVideo === undefined}
|
||||||
data-testid="incall_videomute"
|
data-testid="incall_videomute"
|
||||||
/>,
|
/>,
|
||||||
);
|
);
|
||||||
@@ -137,6 +137,7 @@ export const InCallFooter: FC<InCallFooterProps> = ({
|
|||||||
return (
|
return (
|
||||||
<LoudspeakerButton
|
<LoudspeakerButton
|
||||||
size={buttonSize}
|
size={buttonSize}
|
||||||
|
onClick={() => audioOutputSwitcher.switch()}
|
||||||
isEarpieceTarget={audioOutputSwitcher.targetOutput === "earpiece"}
|
isEarpieceTarget={audioOutputSwitcher.targetOutput === "earpiece"}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ describe("InCallView", () => {
|
|||||||
const { getByRole } = createInCallView({ mediaDevices });
|
const { getByRole } = createInCallView({ mediaDevices });
|
||||||
// The button should be visible. When current output is "speaker",
|
// The button should be visible. When current output is "speaker",
|
||||||
// the switcher targets "earpiece", so the tooltip label is "Handset".
|
// the switcher targets "earpiece", so the tooltip label is "Handset".
|
||||||
const audioOutputBtn = getByRole("button", { name: "Handset" });
|
const audioOutputBtn = getByRole("switch", { name: "Handset" });
|
||||||
expect(audioOutputBtn).toBeVisible();
|
expect(audioOutputBtn).toBeVisible();
|
||||||
|
|
||||||
await user.click(audioOutputBtn);
|
await user.click(audioOutputBtn);
|
||||||
|
|||||||
@@ -565,12 +565,14 @@ export const InCallView: FC<InCallViewProps> = ({
|
|||||||
<SettingsButton key="settings" onClick={openSettings} />,
|
<SettingsButton key="settings" onClick={openSettings} />,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const footerNotNeeded =
|
||||||
|
showControls === false && headerStyle === HeaderStyle.None;
|
||||||
const footer = (
|
const footer = (
|
||||||
<InCallFooter
|
<InCallFooter
|
||||||
ref={footerRef}
|
ref={footerRef}
|
||||||
asOverlay={windowMode === "flat"}
|
asOverlay={windowMode === "flat"}
|
||||||
// TODO this should be computed in the view model!
|
// TODO this should be computed in the view model!
|
||||||
showFooter={!showFooter || (!showControls && headerStyle === "none")}
|
showFooter={showFooter && !footerNotNeeded}
|
||||||
showControls={showControls}
|
showControls={showControls}
|
||||||
showLogo={headerStyle !== HeaderStyle.None}
|
showLogo={headerStyle !== HeaderStyle.None}
|
||||||
showSettingsButton={headerStyle !== HeaderStyle.AppBar}
|
showSettingsButton={headerStyle !== HeaderStyle.AppBar}
|
||||||
|
|||||||
@@ -345,7 +345,30 @@ exports[`InCallView > rendering > renders 1`] = `
|
|||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
|
aria-checked="false"
|
||||||
aria-labelledby="_r_n_"
|
aria-labelledby="_r_n_"
|
||||||
|
class="_button_13vu4_8 shareScreen _has-icon_13vu4_60 _icon-only_13vu4_53"
|
||||||
|
data-kind="secondary"
|
||||||
|
data-size="lg"
|
||||||
|
data-testid="incall_screenshare"
|
||||||
|
role="switch"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
aria-hidden="true"
|
||||||
|
fill="currentColor"
|
||||||
|
height="24"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
width="24"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M1.288 20.713Q1.575 21 2 21h20q.424 0 .712-.288A.97.97 0 0 0 23 20a.97.97 0 0 0-.288-.712A.97.97 0 0 0 22 19H2a.97.97 0 0 0-.712.288A.97.97 0 0 0 1 20q0 .424.288.712m1.3-3.299A1.93 1.93 0 0 1 2 16V5q0-.824.587-1.412A1.93 1.93 0 0 1 4 3h16q.824 0 1.413.587Q22 4.176 22 5v11q0 .824-.587 1.413A1.93 1.93 0 0 1 20 18H4q-.824 0-1.412-.587m10.12-10.12a1 1 0 0 0-1.415 0l-2.5 2.5a1 1 0 0 0 1.414 1.414l.793-.793V13a1 1 0 1 0 2 0v-2.586l.793.793a1 1 0 0 0 1.414-1.414z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
aria-labelledby="_r_s_"
|
||||||
class="_button_13vu4_8 endCall _has-icon_13vu4_60 _icon-only_13vu4_53 _destructive_13vu4_110"
|
class="_button_13vu4_8 endCall _has-icon_13vu4_60 _icon-only_13vu4_53 _destructive_13vu4_110"
|
||||||
data-kind="primary"
|
data-kind="primary"
|
||||||
data-size="lg"
|
data-size="lg"
|
||||||
@@ -371,7 +394,7 @@ exports[`InCallView > rendering > renders 1`] = `
|
|||||||
class="toggle layout"
|
class="toggle layout"
|
||||||
>
|
>
|
||||||
<input
|
<input
|
||||||
aria-labelledby="_r_s_"
|
aria-labelledby="_r_11_"
|
||||||
name="layout"
|
name="layout"
|
||||||
type="radio"
|
type="radio"
|
||||||
value="spotlight"
|
value="spotlight"
|
||||||
@@ -389,7 +412,7 @@ exports[`InCallView > rendering > renders 1`] = `
|
|||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
<input
|
<input
|
||||||
aria-labelledby="_r_11_"
|
aria-labelledby="_r_16_"
|
||||||
checked=""
|
checked=""
|
||||||
name="layout"
|
name="layout"
|
||||||
type="radio"
|
type="radio"
|
||||||
|
|||||||
Reference in New Issue
Block a user