Skip to content

Commit 4f9333c

Browse files
committed
lint
1 parent 699b69f commit 4f9333c

File tree

4 files changed

+35
-46
lines changed

4 files changed

+35
-46
lines changed

src/room/InCallView.module.css

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ Please see LICENSE in the repository root for full details.
9494
justify-self: end;
9595
}
9696

97-
98-
9997
@media (max-width: 370px) {
10098
.raiseHand {
10199
display: none;
@@ -167,4 +165,4 @@ Please see LICENSE in the repository root for full details.
167165
.tile.maximised {
168166
position: relative;
169167
flex-grow: 1;
170-
}
168+
}

src/room/InCallView.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,7 @@ import handSoundOgg from "../sound/raise_hand.ogg?url";
8585
import handSoundMp3 from "../sound/raise_hand.mp3?url";
8686
import { ReactionsAudioRenderer } from "./ReactionAudioRenderer";
8787
import { useSwitchCamera } from "./useSwitchCamera";
88-
import {
89-
soundEffectVolumeSetting,
90-
useSetting,
91-
} from "../settings/settings";
88+
import { soundEffectVolumeSetting, useSetting } from "../settings/settings";
9289
import { ReactionsOverlay } from "./ReactionsOverlay";
9390

9491
const canScreenshare = "getDisplayMedia" in (navigator.mediaDevices ?? {});

src/room/ReactionsOverlay.test.tsx

Lines changed: 32 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,15 @@ import { render } from "@testing-library/react";
99
import { expect, test } from "vitest";
1010
import { TooltipProvider } from "@vector-im/compound-web";
1111
import { act, ReactNode } from "react";
12+
import { afterEach } from "node:test";
1213

1314
import {
1415
MockRoom,
1516
MockRTCSession,
1617
TestReactionsWrapper,
1718
} from "../utils/testReactions";
18-
import {
19-
showReactions,
20-
} from "../settings/settings";
19+
import { showReactions } from "../settings/settings";
2120
import { ReactionsOverlay } from "./ReactionsOverlay";
22-
import { afterEach } from "node:test";
2321
import { ReactionSet } from "../reactions";
2422

2523
const memberUserIdAlice = "@alice:example.org";
@@ -49,7 +47,6 @@ function TestComponent({
4947
);
5048
}
5149

52-
5350
afterEach(() => {
5451
showReactions.setValue(showReactions.defaultValue);
5552
});
@@ -61,51 +58,51 @@ test("defaults to showing no reactions", () => {
6158
membership,
6259
);
6360
const { container } = render(<TestComponent rtcSession={rtcSession} />);
64-
expect(container.getElementsByTagName("span")).toHaveLength(
65-
0
66-
);
61+
expect(container.getElementsByTagName("span")).toHaveLength(0);
6762
});
6863

6964
test("shows a reaction when sent", () => {
7065
showReactions.setValue(true);
7166
const reaction = ReactionSet[0];
7267
const room = new MockRoom(memberUserIdAlice);
73-
const rtcSession = new MockRTCSession(
74-
room,
75-
membership,
76-
);
68+
const rtcSession = new MockRTCSession(room, membership);
7769
const { getByRole } = render(<TestComponent rtcSession={rtcSession} />);
78-
act(() => room.testSendReaction(memberEventAlice, reaction, membership));
79-
const span = getByRole('presentation');
80-
expect(getByRole('presentation')).toBeTruthy();
70+
act(() => {
71+
room.testSendReaction(memberEventAlice, reaction, membership);
72+
});
73+
const span = getByRole("presentation");
74+
expect(getByRole("presentation")).toBeTruthy();
8175
expect(span.innerHTML).toEqual(reaction.emoji);
8276
});
8377

8478
test("shows two of the same reaction when sent", () => {
8579
showReactions.setValue(true);
80+
const reaction = ReactionSet[0];
8681
const room = new MockRoom(memberUserIdAlice);
87-
const rtcSession = new MockRTCSession(
88-
room,
89-
membership,
90-
);
82+
const rtcSession = new MockRTCSession(room, membership);
9183
const { getAllByRole } = render(<TestComponent rtcSession={rtcSession} />);
92-
act(() => room.testSendReaction(memberEventAlice, ReactionSet[0], membership));
93-
act(() => room.testSendReaction(memberEventBob, ReactionSet[0], membership));
94-
expect(getAllByRole('presentation')).toHaveLength(2);
84+
act(() => {
85+
room.testSendReaction(memberEventAlice, reaction, membership);
86+
});
87+
act(() => {
88+
room.testSendReaction(memberEventBob, reaction, membership);
89+
});
90+
expect(getAllByRole("presentation")).toHaveLength(2);
9591
});
9692

9793
test("shows two different reactions when sent", () => {
9894
showReactions.setValue(true);
9995
const room = new MockRoom(memberUserIdAlice);
100-
const rtcSession = new MockRTCSession(
101-
room,
102-
membership,
103-
);
96+
const rtcSession = new MockRTCSession(room, membership);
10497
const [reactionA, reactionB] = ReactionSet;
10598
const { getAllByRole } = render(<TestComponent rtcSession={rtcSession} />);
106-
act(() => room.testSendReaction(memberEventAlice, reactionA, membership));
107-
act(() => room.testSendReaction(memberEventBob, reactionB, membership));
108-
const [reactionElementA, reactionElementB] = getAllByRole('presentation');
99+
act(() => {
100+
room.testSendReaction(memberEventAlice, reactionA, membership);
101+
});
102+
act(() => {
103+
room.testSendReaction(memberEventBob, reactionB, membership);
104+
});
105+
const [reactionElementA, reactionElementB] = getAllByRole("presentation");
109106
expect(reactionElementA.innerHTML).toEqual(reactionA.emoji);
110107
expect(reactionElementB.innerHTML).toEqual(reactionB.emoji);
111108
});
@@ -114,13 +111,10 @@ test("hides reactions when reaction animations are disabled", () => {
114111
showReactions.setValue(false);
115112
const reaction = ReactionSet[0];
116113
const room = new MockRoom(memberUserIdAlice);
117-
const rtcSession = new MockRTCSession(
118-
room,
119-
membership,
120-
);
121-
act(() => room.testSendReaction(memberEventAlice, reaction, membership));
114+
const rtcSession = new MockRTCSession(room, membership);
115+
act(() => {
116+
room.testSendReaction(memberEventAlice, reaction, membership);
117+
});
122118
const { container } = render(<TestComponent rtcSession={rtcSession} />);
123-
expect(container.getElementsByTagName("span")).toHaveLength(
124-
0
125-
);
126-
});
119+
expect(container.getElementsByTagName("span")).toHaveLength(0);
120+
});

src/useReactions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ interface RaisedHandInfo {
6262
time: Date;
6363
}
6464

65-
const REACTION_ACTIVE_TIME_MS = 3000;
65+
const REACTION_ACTIVE_TIME_MS = 90000;
6666

6767
export const useReactions = (): ReactionsContextType => {
6868
const context = useContext(ReactionsContext);

0 commit comments

Comments
 (0)