Compare commits

...

1 Commits

Author SHA1 Message Date
yyh
41d3c8944b test(web): rely on the plugin loading status
Remove per-card skeleton test ids and implementation-count assertions. Keep the existing six-card rendering and spacing unchanged while querying the named loading status as the public contract.
2026-08-09 12:34:42 +08:00
2 changed files with 3 additions and 8 deletions

View File

@@ -312,10 +312,9 @@ describe('PluginsPanel', () => {
render(<PluginsPanel />)
const loadingState = screen.getByRole('status')
const loadingState = screen.getByRole('status', { name: 'common.loading' })
expect(loadingState).toHaveClass('px-12')
expect(screen.getAllByTestId('plugin-card-skeleton')).toHaveLength(6)
})
it('uses compact skeleton spacing while an integrations plugin category is pending', () => {
@@ -329,10 +328,9 @@ describe('PluginsPanel', () => {
render(<PluginsPanel contentInset="compact" fixedCategory={PluginCategoryEnum.tool} />)
const loadingState = screen.getByRole('status')
const loadingState = screen.getByRole('status', { name: 'common.loading' })
expect(loadingState).toHaveClass('px-6', 'max-w-[1600px]')
expect(screen.getAllByTestId('plugin-card-skeleton')).toHaveLength(6)
})
it('uses default content inset for the standalone plugins page', () => {

View File

@@ -4,10 +4,7 @@ import { useTranslation } from 'react-i18next'
import { SkeletonContainer, SkeletonPoint, SkeletonRectangle } from '@/app/components/base/skeleton'
const PluginCardSkeleton = () => (
<div
data-testid="plugin-card-skeleton"
className="relative overflow-hidden rounded-xl border-[1.5px] border-background-section-burn bg-background-section-burn p-1"
>
<div className="relative overflow-hidden rounded-xl border-[1.5px] border-background-section-burn bg-background-section-burn p-1">
<div className="relative rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-on-panel-item-bg p-4 pb-3 shadow-xs">
<div className="flex">
<SkeletonRectangle className="size-10 shrink-0 animate-pulse rounded-xl" />