{pluginLabel}
{' · '}
diff --git a/web/app/components/plugins/marketplace/list/__tests__/card-wrapper.spec.tsx b/web/app/components/plugins/marketplace/list/__tests__/card-wrapper.spec.tsx
index af22694e1c1..6c267825032 100644
--- a/web/app/components/plugins/marketplace/list/__tests__/card-wrapper.spec.tsx
+++ b/web/app/components/plugins/marketplace/list/__tests__/card-wrapper.spec.tsx
@@ -47,20 +47,21 @@ vi.mock('@/app/components/plugins/install-plugin/hooks/use-plugin-install-permis
vi.mock('../../detail-dialog', () => ({
default: ({
+ isInstalled,
open,
onOpenChange,
}: {
+ isInstalled: boolean
open: boolean
onOpenChange: (open: boolean) => void
- }) => open
- ? (
-
-
-
- )
- : null,
+ }) =>
+ open ? (
+
+
+
+ ) : null,
}))
vi.mock('../../utils', () => ({
@@ -140,10 +141,13 @@ describe('CardWrapper', () => {
it('opens and closes marketplace detail dialog from the detail action', async () => {
const user = userEvent.setup()
- renderCardWrapper({ showInstallButton: true })
+ renderCardWrapper({ showInstallButton: true, isInstalled: true })
await user.click(screen.getByRole('button', { name: 'plugin.detailPanel.operation.detail' }))
- expect(screen.getByRole('dialog', { name: 'marketplace detail' })).toBeInTheDocument()
+ expect(screen.getByRole('dialog', { name: 'marketplace detail' })).toHaveAttribute(
+ 'data-installed',
+ 'true',
+ )
await user.click(screen.getByRole('button', { name: 'close detail' }))
expect(screen.queryByRole('dialog', { name: 'marketplace detail' })).not.toBeInTheDocument()
diff --git a/web/app/components/plugins/marketplace/list/card-wrapper.tsx b/web/app/components/plugins/marketplace/list/card-wrapper.tsx
index 4c36b226bd9..face9077e8c 100644
--- a/web/app/components/plugins/marketplace/list/card-wrapper.tsx
+++ b/web/app/components/plugins/marketplace/list/card-wrapper.tsx
@@ -44,10 +44,8 @@ const CardWrapperComponent = ({
[plugin.tags, getTagLabel],
)
const handleMarketplaceDetailOpenChange = (open: boolean) => {
- if (open)
- showMarketplaceDetail()
- else
- hideMarketplaceDetail()
+ if (open) showMarketplaceDetail()
+ else hideMarketplaceDetail()
}
const showInstallAction = !!showInstallButton && canInstallPlugin
@@ -93,6 +91,7 @@ const CardWrapperComponent = ({
/>
)}