feat: implement robustness guards

This commit is contained in:
saturn
2026-03-09 02:53:06 +08:00
parent fba480ae6e
commit be1853534a
25 changed files with 1531 additions and 96 deletions

View File

@@ -107,6 +107,20 @@ function createState(tutorial: ProviderTutorial): UseProviderCardStateResult {
}
}
function ProviderCardShellWithBody(
props: Omit<React.ComponentProps<typeof ProviderCardShell>, 'children'>,
): React.ReactElement {
const ProviderCardShellComponent =
ProviderCardShell as unknown as React.ComponentType<
React.PropsWithChildren<Omit<React.ComponentProps<typeof ProviderCardShell>, 'children'>>
>
return createElement(
ProviderCardShellComponent,
props,
createElement('div', null, 'provider-body'),
)
}
describe('ProviderCardShell tutorial modal', () => {
afterEach(() => {
vi.clearAllMocks()
@@ -145,7 +159,7 @@ describe('ProviderCardShell tutorial modal', () => {
const html = renderToStaticMarkup(
createElement(
ProviderCardShell,
ProviderCardShellWithBody,
{
provider: {
id: 'ark',
@@ -156,7 +170,6 @@ describe('ProviderCardShell tutorial modal', () => {
t,
state,
},
createElement('div', null, 'provider-body'),
),
)