[MM-67135] show premade themes when custom themes are disabled (#35540)

This commit is contained in:
David Krauser
2026-03-16 11:48:25 -04:00
committed by GitHub
parent 02b9266653
commit 39f7f4fddf
2 changed files with 23 additions and 0 deletions
@@ -64,6 +64,27 @@ describe('components/user_settings/display/user_settings_theme/user_settings_the
expect(requiredProps.actions.saveTheme).toHaveBeenCalled();
});
it('should show premade themes when custom themes are disabled', () => {
const props = {
...requiredProps,
selected: true,
allowCustomThemes: false,
};
renderWithContext(
<UserSettingsTheme {...props}/>,
);
// Premade theme chooser should still be rendered
expect(screen.getByText('Save')).toBeInTheDocument();
expect(screen.queryByLabelText('Premade Themes')).not.toBeInTheDocument();
expect(screen.queryByLabelText('Custom Theme')).not.toBeInTheDocument();
// The premade themes should be visible (theme thumbnails are rendered)
const premadeThemes = document.querySelectorAll('.premade-themes');
expect(premadeThemes.length).toBeGreaterThan(0);
});
it('should deleteTeamSpecificThemes if applyToAllTeams is enabled', async () => {
const props = {
...requiredProps,
@@ -238,6 +238,8 @@ export default class ThemeSetting extends React.PureComponent<Props, State> {
</ExternalLink>
</div>,
);
} else {
inputs.push(premade);
}
let allTeamsCheckbox = null;