mirror of
https://github.com/mattermost/mattermost.git
synced 2026-08-27 05:37:15 -05:00
[MM-67135] show premade themes when custom themes are disabled (#35540)
This commit is contained in:
+21
@@ -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,
|
||||
|
||||
+2
@@ -238,6 +238,8 @@ export default class ThemeSetting extends React.PureComponent<Props, State> {
|
||||
</ExternalLink>
|
||||
</div>,
|
||||
);
|
||||
} else {
|
||||
inputs.push(premade);
|
||||
}
|
||||
|
||||
let allTeamsCheckbox = null;
|
||||
|
||||
Reference in New Issue
Block a user