Skip to content

Commit

Permalink
TCHAP: fix lint and tests issues
Browse files Browse the repository at this point in the history
  • Loading branch information
marc.sirisak committed Jan 14, 2025
1 parent 748b90f commit 93232e9
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 35 deletions.
38 changes: 19 additions & 19 deletions README_tchap.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
## Config variable

- tchap_features : Object containing the feature that can be activated by homeserver
- "feature_email_notification": Email notification
- "feature_space": Creation of spaces
- "feature_thread": Activate thread on messages
- "feature_audio_call": Activate 1 to 1 voice call
- "feature_video_call": Activate 1 to 1 video call
- "feature_video_group_call": Activate group call on rooms, for this feature to work, the values of `UIFeature.widgets` and `feature_group_calls` needs to be true
- "feature_screenshare_call": Activate 1 to 1 screenshare
- "tchap_sso_flow"
- "isActive": Activate ProConnect SSO flow
- tchap_features : Object containing the feature that can be activated by homeserver
- "feature_email_notification": Email notification
- "feature_space": Creation of spaces
- "feature_thread": Activate thread on messages
- "feature_audio_call": Activate 1 to 1 voice call
- "feature_video_call": Activate 1 to 1 video call
- "feature_video_group_call": Activate group call on rooms, for this feature to work, the values of `UIFeature.widgets` and `feature_group_calls` needs to be true
- "feature_screenshare_call": Activate 1 to 1 screenshare
- "tchap_sso_flow"
- "isActive": Activate ProConnect SSO flow

## File structures

- modules -> used for translation
- yarn-linked-dependencies -> legacy dependencies used for matrix-js-sdk
- patches_legacy -> legacy patches directory in which code for the patches where put
- patches -> used for matrix-js-sdk patches
- src -> code containing ex matrix-react-sdk lib and element-web code
- modules -> used for translation
- yarn-linked-dependencies -> legacy dependencies used for matrix-js-sdk
- patches_legacy -> legacy patches directory in which code for the patches where put
- patches -> used for matrix-js-sdk patches
- src -> code containing ex matrix-react-sdk lib and element-web code

## Local dev installation

Expand All @@ -31,8 +31,8 @@ yarn start

### Making a change

- In element code :
You need to add around your code those comments
- In element code :
You need to add around your code those comments

```
// :TCHAP: NAME_OF_THE_PATCH
Expand All @@ -44,5 +44,5 @@ Then also update the `subtree-modifications.json` file. We continue to keep trac

### Tests

- Now that `matrix-react-sdk` is merged inside tchap-web, we only target the `test/tchap` folder in order to run our tests on only the files that tchap has modified.
- For every modification, we need to copy the existing test (if there is one) of the component, move it to tchap folder and modify it accordingly.
- Now that `matrix-react-sdk` is merged inside tchap-web, we only target the `test/tchap` folder in order to run our tests on only the files that tchap has modified.
- For every modification, we need to copy the existing test (if there is one) of the component, move it to tchap folder and modify it accordingly.
4 changes: 2 additions & 2 deletions cypress/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# How to run cypress tests locally

- run a local instance of tchap-web in your environment
- run a local instance of tchap-web in your environment

```
yarn start
```

- run cypress
- run cypress

Make a .env file, by coying .env.example. Set values for the `E2E_TEST_*` variables. Tests will run on your localhost, so make sure the test user exists in the backend called by localhost.

Expand Down
6 changes: 3 additions & 3 deletions modules/tchap-translations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

## What are all these translation files ?

- `tchap_translations.json` : translations for strings that Tchap code adds to the web and react-sdk repos.
- `tchap_translations.json` : translations for strings that Tchap code adds to the web and react-sdk repos.

- `tchap_translations_removed.json` : strings that tchap modifications have removed from element code. They are listed explicitly because otherwise the translation-checking script will fail (see below).
- `tchap_translations_removed.json` : strings that tchap modifications have removed from element code. They are listed explicitly because otherwise the translation-checking script will fail (see below).

- `old/tchap_translations_lost.json` : translations that were present in previous versions, but that don't correspond to any existing code now. Many correspond to customisations made in tchap-web v2. Keeping them around in case they're useful.
- `old/tchap_translations_lost.json` : translations that were present in previous versions, but that don't correspond to any existing code now. Many correspond to customisations made in tchap-web v2. Keeping them around in case they're useful.

## The translation-checking script

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
mockClientMethodsUser,
mockPlatformPeg,
} from "~tchap-web/test/test-utils";
import { useId } from "~tchap-web/src/utils/useId";

jest.mock(
"~tchap-web/src/components/views/settings/ChangePassword",
Expand All @@ -26,8 +25,6 @@ jest.mock(
},
);

jest.mock("~tchap-web/src/utils/useId");

describe("<AccountUserSettingsTab />", () => {
const defaultProps = {
closeSettingsFn: jest.fn(),
Expand Down Expand Up @@ -79,8 +76,6 @@ describe("<AccountUserSettingsTab />", () => {
(settingName: string) => settingName === UIFeature.Deactivate,
);

// labelled id on username is autogeneraed, we fix it so that snapshot is always the same
mocked(useId).mockImplementation(() => "1234");
});

afterEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ exports[`<AccountUserSettingsTab /> common view snapshot should render section w
>
<label
class="_label_ssths_67"
for="radix-:r0:"
for="radix-:r1:"
>
Display Name
</label>
Expand All @@ -67,7 +67,7 @@ exports[`<AccountUserSettingsTab /> common view snapshot should render section w
<input
class="_control_9gon8_18"
disabled=""
id="radix-:r0:"
id="radix-:r1:"
name="input"
title=""
value=""
Expand All @@ -81,12 +81,12 @@ exports[`<AccountUserSettingsTab /> common view snapshot should render section w
>
<div
class="mx_UserProfileSettings_profile_controls_userId_label"
id="1234"
id=":r2:"
>
Username
</div>
<div
aria-labelledby="1234"
aria-labelledby=":r2:"
class="mx_CopyableText mx_CopyableText_border"
>
@alice:server.org
Expand Down
2 changes: 0 additions & 2 deletions test/unit-tests/tchap/stores/RoomViewStore-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { SlidingSyncManager } from "~tchap-web/src/SlidingSyncManager";
import { PosthogAnalytics } from "~tchap-web/src/PosthogAnalytics";
import { MatrixDispatcher } from "~tchap-web/src/dispatcher/dispatcher";
import { SpaceStoreClass } from "~tchap-web/src/stores/spaces/SpaceStore";
import { VoiceBroadcastPlaybacksStore } from "~tchap-web/src/voice-broadcast";
import Modal from "~tchap-web/src/Modal";
import ExternalAccountHandler from "~tchap-web/src/tchap/lib/ExternalAccountHandler";
import { _t } from "~tchap-web/src/languageHandler";
Expand Down Expand Up @@ -95,7 +94,6 @@ describe("RoomViewStore", function () {
stores._SlidingSyncManager = slidingSyncManager;
stores._PosthogAnalytics = new MockPosthogAnalytics();
stores._SpaceStore = new MockSpaceStore();
stores._VoiceBroadcastPlaybacksStore = new VoiceBroadcastPlaybacksStore(stores.voiceBroadcastRecordingsStore);
roomViewStore = new RoomViewStore(dis, stores);
stores._RoomViewStore = roomViewStore;

Expand Down

0 comments on commit 93232e9

Please sign in to comment.