Skip to content

Commit 5a30404

Browse files
committed
refactor: split code block themes into their own section
1 parent 13bf74d commit 5a30404

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

src/app/features/settings/cosmetics/Themes.test.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,19 @@ const clickLatestButton = (name: string) => {
9191
};
9292

9393
describe('Appearance settings', () => {
94-
it('renders shared selector-backed theme controls and code block system/manual selectors', () => {
94+
it('renders Theme, Code Block Theme, and Visual Tweaks as separate sections', () => {
9595
render(<Appearance />);
9696

97+
const themeHeading = screen.getByText('Theme');
98+
const codeBlockThemeHeading = screen.getByText('Code Block Theme');
99+
const visualTweaksHeading = screen.getByText('Visual Tweaks');
100+
101+
expect(themeHeading.compareDocumentPosition(codeBlockThemeHeading)).toBe(
102+
Node.DOCUMENT_POSITION_FOLLOWING
103+
);
104+
expect(codeBlockThemeHeading.compareDocumentPosition(visualTweaksHeading)).toBe(
105+
Node.DOCUMENT_POSITION_FOLLOWING
106+
);
97107
expect(screen.getByRole('button', { name: 'Silver' })).toBeInTheDocument();
98108
expect(screen.getByRole('button', { name: 'Cinny Light' })).toBeInTheDocument();
99109
expect(screen.getByRole('button', { name: 'Black' })).toBeInTheDocument();

src/app/features/settings/cosmetics/Themes.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,6 @@ function ThemeSettings() {
309309
/>
310310
</SequenceCard>
311311

312-
<CodeBlockThemeSettings />
313-
314312
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
315313
<SettingTile
316314
title="Saturation"
@@ -474,6 +472,7 @@ export function Appearance() {
474472
return (
475473
<Box direction="Column" gap="700">
476474
<ThemeSettings />
475+
<CodeBlockThemeSettings />
477476

478477
<Box direction="Column" gap="100">
479478
<Text size="L400">Visual Tweaks</Text>

0 commit comments

Comments
 (0)