Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 9c8c9cc

Browse files
author
Kerry Archibald
committed
setup for tests
Signed-off-by: Kerry Archibald <[email protected]>
1 parent 1988067 commit 9c8c9cc

File tree

4 files changed

+39
-0
lines changed

4 files changed

+39
-0
lines changed

src/i18n/strings/en_EN.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2956,6 +2956,7 @@
29562956
"Beta": "Beta",
29572957
"Leave the beta": "Leave the beta",
29582958
"Join the beta": "Join the beta",
2959+
"You are sharing your live location": "You are sharing your live location",
29592960
"Avatar": "Avatar",
29602961
"This room is public": "This room is public",
29612962
"Away": "Away",
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`<LeftPanelLiveShareWarning /> renders correctly when minimized 1`] = `
4+
<LeftPanelLiveShareWarning
5+
isMinimized={true}
6+
/>
7+
`;
8+
9+
exports[`<LeftPanelLiveShareWarning /> renders correctly when not minimized 1`] = `<LeftPanelLiveShareWarning />`;

test/stores/OwnBeaconStore-test.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { Room } from "matrix-js-sdk/src/matrix";
2+
// import { makeBeaconInfoEvent } from "matrix-js-sdk/spec/test-utils/beacon";
3+
4+
import { OwnBeaconStore } from "../../src/stores/OwnBeaconStore";
5+
import { getMockClientWithEventEmitter } from "../test-utils/client";
6+
7+
describe('OwnBeaconStore', () => {
8+
const aliceId = '@alice:server.org';
9+
const mockClient = getMockClientWithEventEmitter({
10+
getUserId: jest.fn().mockReturnValue(aliceId),
11+
getVisibleRooms: jest.fn().mockReturnValue([]),
12+
});
13+
const room1 = new Room('$room1:server.org', mockClient, aliceId);
14+
const room2 = new Room('$room2:server.org', mockClient, aliceId);
15+
16+
// const alicesRoom1BeaconInfo = makeBeaconInfoEvent(aliceId, room1.roomId, { isLive: true }, '$alice-room1-1');
17+
18+
beforeEach(() => {
19+
mockClient.getVisibleRooms.mockReturnValue([room1, room2]);
20+
});
21+
22+
it('initialises correctly with no beacons', () => {
23+
const store = new OwnBeaconStore();
24+
expect(store.hasLiveBeacons()).toBe(false);
25+
expect(store.hasLiveBeacons(room1.roomId)).toBe(false);
26+
});
27+
});

test/test-utils/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
export * from './beacon';
2+
export * from './client';
13
export * from './test-utils';
24
export * from './wrappers';
35
export * from './utilities';

0 commit comments

Comments
 (0)