Add tests for AuthContext, ModalContext and ThemeContext

This commit is contained in:
2025-05-29 16:25:42 +02:00
parent 19771dd094
commit 33d45568ec
6 changed files with 2406 additions and 4 deletions

View File

@@ -22,13 +22,16 @@ export const ThemeProvider: React.FC<ThemeProviderProps> = ({ children }) => {
const updateColorScheme = useCallback(
(newTheme: MantineColorScheme): void => {
setColorScheme(newTheme);
if (setColorScheme) {
setColorScheme(newTheme);
}
},
[setColorScheme]
);
// Ensure colorScheme is never undefined by falling back to light theme
const value: ThemeContextType = {
colorScheme,
colorScheme: colorScheme || 'light',
updateColorScheme,
};