test(frontend-admin): ✅ Add mock implementation for @lilith/ui-styled-components in frontend admin test setup
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
934e921ff7
commit
2d3e84d4be
1 changed files with 5 additions and 32 deletions
|
|
@ -1,15 +1,13 @@
|
|||
/**
|
||||
* Mock for @lilith/ui-styled-components used in tests.
|
||||
*
|
||||
* Provides a passthrough `styled` factory so component trees render in jsdom
|
||||
* without requiring the full ThemeProvider context. All theme accessors in
|
||||
* styled template literals are ignored at test time — only the rendered HTML
|
||||
* and component logic are exercised.
|
||||
* Provides a passthrough `styled` factory and a no-theme ThemeProvider so
|
||||
* component trees render in jsdom without requiring the full theme shape.
|
||||
* All theme accessors in styled template literals are ignored at test time
|
||||
* — only the rendered HTML and component logic are exercised.
|
||||
*/
|
||||
import React from 'react';
|
||||
import type { ReactNode } from 'react';
|
||||
import styledActual, {
|
||||
ThemeProvider as ThemeProviderActual,
|
||||
createGlobalStyle as createGlobalStyleActual,
|
||||
css as cssActual,
|
||||
keyframes as keyframesActual,
|
||||
|
|
@ -17,33 +15,8 @@ import styledActual, {
|
|||
ServerStyleSheet as ServerStyleSheetActual,
|
||||
} from 'styled-components';
|
||||
|
||||
const theme = {
|
||||
spacing: {
|
||||
xs: '4px',
|
||||
sm: '8px',
|
||||
md: '16px',
|
||||
lg: '24px',
|
||||
xl: '32px',
|
||||
},
|
||||
borderRadius: {
|
||||
sm: '4px',
|
||||
md: '6px',
|
||||
lg: '12px',
|
||||
xl: '16px',
|
||||
full: '9999px',
|
||||
},
|
||||
colors: {
|
||||
primary: { main: '#7c3aed', light: '#a78bfa', dark: '#5b21b6' },
|
||||
background: { primary: '#ffffff', secondary: '#f9fafb', tertiary: '#f3f4f6' },
|
||||
text: { primary: '#111827', secondary: '#6b7280', muted: '#9ca3af' },
|
||||
border: { default: '#e5e7eb', hover: '#d1d5db' },
|
||||
},
|
||||
};
|
||||
|
||||
function ThemeProvider({ children }: { children: ReactNode }) {
|
||||
return (
|
||||
<ThemeProviderActual theme={theme}>{children}</ThemeProviderActual>
|
||||
);
|
||||
return <>{children}</>;
|
||||
}
|
||||
|
||||
export default styledActual;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue