mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-07-21 01:05:30 +00:00
fix(tests): add missing Mantine component mocks for EPG.jsx SD components
This commit is contained in:
parent
6b9d621cf7
commit
72aad57a2d
1 changed files with 26 additions and 0 deletions
|
|
@ -184,6 +184,32 @@ vi.mock('@mantine/core', async () => ({
|
|||
{error && <span data-testid="input-error">{error}</span>}
|
||||
</div>
|
||||
),
|
||||
Alert: ({ children, title, color, icon }) => (
|
||||
<div data-testid="alert" data-color={color}>
|
||||
{title && <div data-testid="alert-title">{title}</div>}
|
||||
{children}
|
||||
</div>
|
||||
),
|
||||
Select: ({ label, value, onChange, data, placeholder }) => (
|
||||
<select
|
||||
aria-label={label}
|
||||
data-testid={`select-${label?.toString().toLowerCase().replace(/\s+/g, '-')}`}
|
||||
value={value ?? ''}
|
||||
onChange={(e) => onChange?.(e.target.value)}
|
||||
>
|
||||
<option value="">{placeholder}</option>
|
||||
{(data ?? []).map((opt) => {
|
||||
const val = typeof opt === 'string' ? opt : opt.value;
|
||||
const lbl = typeof opt === 'string' ? opt : opt.label;
|
||||
return <option key={val} value={val}>{lbl}</option>;
|
||||
})}
|
||||
</select>
|
||||
),
|
||||
Loader: ({ size }) => <div data-testid="loader" data-size={size} />,
|
||||
Badge: ({ children, color }) => <span data-testid="badge" data-color={color}>{children}</span>,
|
||||
ScrollArea: ({ children }) => <div data-testid="scroll-area">{children}</div>,
|
||||
Table: ({ children }) => <table>{children}</table>,
|
||||
Tooltip: ({ children }) => <div>{children}</div>,
|
||||
}));
|
||||
|
||||
// ── Imports after mocks ────────────────────────────────────────────────────────
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue