Update to React 18 (#24763)

* Upgrade target to es2021

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Upgrade target to es2021

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Upgrade to es2022

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Upgrade to es2022

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Fix babel config

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Fix babel config

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Fix React contexts

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Fix types

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Fix React state

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update to React 18

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update to React 18

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Install @testing-library/dom

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Update lockfile

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Yarn lock update

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2024-10-21 14:50:06 +01:00 committed by GitHub
parent 772019711d
commit d8800ef987
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
81 changed files with 1056 additions and 1403 deletions

View file

@ -915,7 +915,7 @@ describe("<SessionManagerTab />", () => {
const { getByTestId, findByTestId } = render(getComponent());
await waitForElementToBeRemoved(() => screen.queryAllByRole("progressbar"));
await toggleDeviceDetails(getByTestId, alicesMobileDevice.device_id);
toggleDeviceDetails(getByTestId, alicesMobileDevice.device_id);
const signOutButton = await within(
await findByTestId(`device-detail-${alicesMobileDevice.device_id}`),
@ -1024,7 +1024,7 @@ describe("<SessionManagerTab />", () => {
fireEvent.submit(getByLabelText("Password"));
});
await flushPromises();
await act(flushPromises);
// called again with auth
expect(mockClient.deleteMultipleDevices).toHaveBeenCalledWith([alicesMobileDevice.device_id], {
@ -1032,7 +1032,7 @@ describe("<SessionManagerTab />", () => {
type: "m.id.user",
user: aliceId,
},
password: "",
password: "topsecret",
type: "m.login.password",
});
// devices refreshed

View file

@ -58,17 +58,16 @@ describe("<VoiceUserSettingsTab />", () => {
describe("devices", () => {
it("renders dropdowns for input devices", async () => {
render(getComponent());
await flushPromises();
expect(screen.getByLabelText("Microphone")).toHaveDisplayValue(audioIn1.label);
expect(screen.getByLabelText("Camera")).toHaveDisplayValue(videoIn1.label);
await expect(screen.findByLabelText("Microphone")).resolves.toHaveDisplayValue(audioIn1.label);
await expect(screen.findByLabelText("Camera")).resolves.toHaveDisplayValue(videoIn1.label);
});
it("updates device", async () => {
render(getComponent());
await flushPromises();
fireEvent.change(screen.getByLabelText("Camera"), { target: { value: videoIn2.deviceId } });
fireEvent.change(await screen.findByLabelText("Camera"), { target: { value: videoIn2.deviceId } });
expect(MediaDeviceHandlerMock.instance.setDevice).toHaveBeenCalledWith(
videoIn2.deviceId,

View file

@ -46,7 +46,7 @@ exports[`AppearanceUserSettingsTab should render 1`] = `
<input
class="_input_1vw5h_26"
disabled=""
id="radix-0"
id="radix-:r0:"
name="themeSelector"
title=""
type="radio"
@ -62,7 +62,7 @@ exports[`AppearanceUserSettingsTab should render 1`] = `
>
<label
class="_label_dgy0u_67 mx_ThemeChoicePanel_themeSelector_Label"
for="radix-0"
for="radix-:r0:"
>
Light
</label>
@ -80,7 +80,7 @@ exports[`AppearanceUserSettingsTab should render 1`] = `
<input
class="_input_1vw5h_26"
disabled=""
id="radix-1"
id="radix-:r1:"
name="themeSelector"
title=""
type="radio"
@ -96,7 +96,7 @@ exports[`AppearanceUserSettingsTab should render 1`] = `
>
<label
class="_label_dgy0u_67 mx_ThemeChoicePanel_themeSelector_Label"
for="radix-1"
for="radix-:r1:"
>
Dark
</label>
@ -114,7 +114,7 @@ exports[`AppearanceUserSettingsTab should render 1`] = `
<input
class="_input_1vw5h_26"
disabled=""
id="radix-2"
id="radix-:r2:"
name="themeSelector"
title=""
type="radio"
@ -130,7 +130,7 @@ exports[`AppearanceUserSettingsTab should render 1`] = `
>
<label
class="_label_dgy0u_67 mx_ThemeChoicePanel_themeSelector_Label"
for="radix-2"
for="radix-:r2:"
>
High contrast
</label>
@ -170,7 +170,7 @@ exports[`AppearanceUserSettingsTab should render 1`] = `
<label
aria-label="Modern"
class="_label_dgy0u_67"
for="radix-3"
for="radix-:r3:"
>
<div
class="mxLayoutSwitcher_LayoutSelector_LayoutRadio_inline"
@ -181,7 +181,7 @@ exports[`AppearanceUserSettingsTab should render 1`] = `
<input
checked=""
class="_input_1vw5h_26"
id="radix-3"
id="radix-:r3:"
name="layout"
title=""
type="radio"
@ -297,7 +297,7 @@ exports[`AppearanceUserSettingsTab should render 1`] = `
<label
aria-label="Message bubbles"
class="_label_dgy0u_67"
for="radix-4"
for="radix-:rc:"
>
<div
class="mxLayoutSwitcher_LayoutSelector_LayoutRadio_inline"
@ -307,7 +307,7 @@ exports[`AppearanceUserSettingsTab should render 1`] = `
>
<input
class="_input_1vw5h_26"
id="radix-4"
id="radix-:rc:"
name="layout"
title=""
type="radio"
@ -423,7 +423,7 @@ exports[`AppearanceUserSettingsTab should render 1`] = `
<label
aria-label="IRC (experimental)"
class="_label_dgy0u_67"
for="radix-5"
for="radix-:rl:"
>
<div
class="mxLayoutSwitcher_LayoutSelector_LayoutRadio_inline"
@ -433,7 +433,7 @@ exports[`AppearanceUserSettingsTab should render 1`] = `
>
<input
class="_input_1vw5h_26"
id="radix-5"
id="radix-:rl:"
name="layout"
title=""
type="radio"
@ -557,9 +557,9 @@ exports[`AppearanceUserSettingsTab should render 1`] = `
class="_container_qnvru_18"
>
<input
aria-describedby="radix-6"
aria-describedby="radix-:rv:"
class="_input_qnvru_32"
id="radix-7"
id="radix-:ru:"
name="compactLayout"
title=""
type="checkbox"
@ -574,13 +574,13 @@ exports[`AppearanceUserSettingsTab should render 1`] = `
>
<label
class="_label_dgy0u_67"
for="radix-7"
for="radix-:ru:"
>
Show compact text and messages
</label>
<span
class="_message_dgy0u_98 _help-message_dgy0u_104"
id="radix-6"
id="radix-:rv:"
>
Modern layout must be selected to use this feature.
</span>

View file

@ -129,7 +129,6 @@ exports[`<SecurityUserSettingsTab /> renders security section 1`] = `
</th>
<td>
not found locally
</td>
</tr>
<tr>

View file

@ -370,7 +370,7 @@ exports[`<SessionManagerTab /> goes to filtered list from security recommendatio
>
<input
aria-label="Select all"
aria-labelledby="floating-ui-142"
aria-labelledby=":r4e:"
data-testid="device-select-all-checkbox"
id="device-select-all-checkbox"
type="checkbox"