Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor proposal #468

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
22 changes: 20 additions & 2 deletions react/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
module.exports = {
env: {
browser: true,
es6: true,
node: true
},
plugins: [
'react-compiler',
'react',
'react-compiler'
],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
},
rules: {
'react-compiler/react-compiler': 'error',
'react-compiler/react-compiler': 'error'
},
settings: {
react: {
version: 'detect'
}
}
};
4 changes: 2 additions & 2 deletions react/src/Components/Footer/Components/CameraButton.js
Original file line number Diff line number Diff line change
@@ -20,10 +20,10 @@ function CameraButton(props) {
<div style={{ display: "flex", alignItems: "center", gap: 8 }}>
<SvgIcon
size={24}
name={isTurningOff ? "camera-off" : "camera"}
name={isTurningOff ? "camera" : "camera-off"}
color="#fff"
/>
{isTurningOff ? t("Camera turned off") : t("Camera turned on")}
{isTurningOff ? t("Camera turned on") : t("Camera turned off")}
</div>
);

32 changes: 32 additions & 0 deletions react/src/__mocks__/useSpeedTest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { useRef } from 'react';

const mockSpeedTestStreamId = useRef('test-stream-id-12345');
const mockStatsList = useRef([]);
const mockSpeedTestCounter = useRef(0);

const mockSpeedTestResults = {
message: "Your connection is Great!",
isfinished: true,
isfailed: false,
errorMessage: "",
progressValue: 100
};

const useSpeedTest = jest.fn().mockImplementation(() => {
return {
startSpeedTest: jest.fn(),
stopSpeedTest: jest.fn(),
speedTestResults: mockSpeedTestResults,
speedTestInProgress: false,
speedTestProgress: 100,
speedTestStreamId: mockSpeedTestStreamId,
setAndFillPlayStatsList: jest.fn(),
setAndFillPublishStatsList: jest.fn(),
speedTestCounter: mockSpeedTestCounter,
statsList: mockStatsList,
calculateThePlaySpeedTestResult: jest.fn(),
processUpdatedStatsForPlaySpeedTest: jest.fn()
};
});

export default useSpeedTest;
850 changes: 850 additions & 0 deletions react/src/__tests__/hooks/useSpeedTest.test.js

Large diffs are not rendered by default.

1,335 changes: 753 additions & 582 deletions react/src/__tests__/pages/AntMedia.test.js

Large diffs are not rendered by default.

478 changes: 478 additions & 0 deletions react/src/hooks/useSpeedTest.js

Large diffs are not rendered by default.

485 changes: 44 additions & 441 deletions react/src/pages/AntMedia.js

Large diffs are not rendered by default.