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

Commit 27188d8

Browse files
committed
Fix ThemeChoicePanel-test.tsx
1 parent 1abdbc4 commit 27188d8

File tree

3 files changed

+105
-43
lines changed

3 files changed

+105
-43
lines changed

src/components/views/settings/ThemeChoicePanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {
2727
} from "@vector-im/compound-web";
2828
import { Icon as DeleteIcon } from "@vector-im/compound-design-tokens/icons/delete.svg";
2929
import classNames from "classnames";
30+
import { logger } from "matrix-js-sdk/src/logger";
3031

3132
import { _t } from "../../../languageHandler";
3233
import SettingsSubsection from "./shared/SettingsSubsection";
@@ -39,7 +40,6 @@ import { Action } from "../../../dispatcher/actions";
3940
import { useTheme } from "../../../hooks/useTheme";
4041
import { findHighContrastTheme, getOrderedThemes, CustomTheme as CustomThemeType, ITheme } from "../../../theme";
4142
import { useSettingValue } from "../../../hooks/useSettings";
42-
import { logger } from "../../../../../matrix-js-sdk/src/logger";
4343

4444
/**
4545
* Interface for the theme state

test/components/views/settings/ThemeChoicePanel-test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import React from "react";
1818
import { render } from "@testing-library/react";
1919

2020
import * as TestUtils from "../../../test-utils";
21-
import ThemeChoicePanel from "../../../../src/components/views/settings/ThemeChoicePanel";
21+
import { ThemeChoicePanel } from "../../../../src/components/views/settings/ThemeChoicePanel";
2222

2323
describe("ThemeChoicePanel", () => {
2424
it("renders the theme choice UI", () => {

test/components/views/settings/__snapshots__/ThemeChoicePanel-test.tsx.snap

Lines changed: 103 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3,71 +3,133 @@
33
exports[`ThemeChoicePanel renders the theme choice UI 1`] = `
44
<DocumentFragment>
55
<div
6-
class="mx_SettingsSubsection"
7-
data-testid="mx_ThemeChoicePanel"
6+
class="mx_SettingsSubsection mx_SettingsSubsection_newUi"
87
>
98
<div
109
class="mx_SettingsSubsectionHeading"
1110
>
1211
<h3
13-
class="mx_Heading_h4 mx_SettingsSubsectionHeading_heading"
12+
class="mx_Heading_h3 mx_SettingsSubsectionHeading_heading"
1413
>
1514
Theme
1615
</h3>
1716
</div>
1817
<div
19-
class="mx_SettingsSubsection_content"
18+
class="mx_SettingsSubsection_content mx_SettingsSubsection_content_newUi"
2019
>
21-
<div
22-
class="mx_ThemeChoicePanel_themeSelectors"
23-
data-testid="theme-choice-panel-selectors"
20+
<form
21+
class="_root_578ve_24 mx_ThemeChoicePanel_ThemeSelectors"
2422
>
25-
<label
26-
class="mx_StyledRadioButton mx_ThemeSelector_light mx_StyledRadioButton_disabled mx_StyledRadioButton_outlined"
23+
<div
24+
class="_inline-field_578ve_40 mx_ThemeChoicePanel_themeSelector mx_ThemeChoicePanel_themeSelector_disabled cpd-theme-light"
2725
>
28-
<input
29-
disabled=""
30-
id="theme-light"
31-
name="theme"
32-
type="radio"
33-
value="light"
34-
/>
35-
<div>
36-
<div />
37-
</div>
3826
<div
39-
class="mx_StyledRadioButton_content"
27+
class="_inline-field-control_578ve_52"
4028
>
41-
Light
29+
<div
30+
class="_container_bdln6_18"
31+
>
32+
<input
33+
class="_input_bdln6_26"
34+
disabled=""
35+
id="radix-0"
36+
name="themeSelector"
37+
title=""
38+
type="radio"
39+
value="light"
40+
/>
41+
<div
42+
class="_ui_bdln6_27"
43+
/>
44+
</div>
4245
</div>
4346
<div
44-
class="mx_StyledRadioButton_spacer"
45-
/>
46-
</label>
47-
<label
48-
class="mx_StyledRadioButton mx_ThemeSelector_dark mx_StyledRadioButton_disabled mx_StyledRadioButton_outlined"
47+
class="_inline-field-body_578ve_46"
48+
>
49+
<label
50+
class="_label_578ve_67 mx_ThemeChoicePanel_themeSelector_Label"
51+
for="radix-0"
52+
>
53+
Light
54+
</label>
55+
</div>
56+
</div>
57+
<div
58+
class="_inline-field_578ve_40 mx_ThemeChoicePanel_themeSelector mx_ThemeChoicePanel_themeSelector_disabled cpd-theme-dark"
4959
>
50-
<input
51-
disabled=""
52-
id="theme-dark"
53-
name="theme"
54-
type="radio"
55-
value="dark"
56-
/>
57-
<div>
58-
<div />
60+
<div
61+
class="_inline-field-control_578ve_52"
62+
>
63+
<div
64+
class="_container_bdln6_18"
65+
>
66+
<input
67+
class="_input_bdln6_26"
68+
disabled=""
69+
id="radix-1"
70+
name="themeSelector"
71+
title=""
72+
type="radio"
73+
value="dark"
74+
/>
75+
<div
76+
class="_ui_bdln6_27"
77+
/>
78+
</div>
79+
</div>
80+
<div
81+
class="_inline-field-body_578ve_46"
82+
>
83+
<label
84+
class="_label_578ve_67 mx_ThemeChoicePanel_themeSelector_Label"
85+
for="radix-1"
86+
>
87+
Dark
88+
</label>
5989
</div>
90+
</div>
91+
<div
92+
class="_inline-field_578ve_40 mx_ThemeChoicePanel_themeSelector mx_ThemeChoicePanel_themeSelector_disabled cpd-theme-light"
93+
>
6094
<div
61-
class="mx_StyledRadioButton_content"
95+
class="_inline-field-control_578ve_52"
6296
>
63-
Dark
97+
<div
98+
class="_container_bdln6_18"
99+
>
100+
<input
101+
class="_input_bdln6_26"
102+
disabled=""
103+
id="radix-2"
104+
name="themeSelector"
105+
title=""
106+
type="radio"
107+
value="light-high-contrast"
108+
/>
109+
<div
110+
class="_ui_bdln6_27"
111+
/>
112+
</div>
64113
</div>
65114
<div
66-
class="mx_StyledRadioButton_spacer"
67-
/>
68-
</label>
69-
</div>
115+
class="_inline-field-body_578ve_46"
116+
>
117+
<label
118+
class="_label_578ve_67 mx_ThemeChoicePanel_themeSelector_Label"
119+
for="radix-2"
120+
>
121+
High contrast
122+
</label>
123+
</div>
124+
</div>
125+
</form>
70126
</div>
127+
<div
128+
class="_separator_144s5_17"
129+
data-kind="primary"
130+
data-orientation="horizontal"
131+
role="separator"
132+
/>
71133
</div>
72134
</DocumentFragment>
73135
`;

0 commit comments

Comments
 (0)