Skip to content

fix(gui): PluginMarketplace unhandled error — 'filter' of undefined in tests #504

@amiable-dev

Description

@amiable-dev

Description

When running npx vitest run, WorkspacePanel tests trigger an unhandled exception in PluginMarketplace:

TypeError: Cannot read properties of undefined (reading 'filter')
  in PluginMarketplace.svelte
  in PluginView.svelte
  in WorkspacePanel.svelte

This occurs twice (in two different WorkspacePanel test contexts). The root cause is that the invoke('get_plugin_registry') mock returns undefined instead of an object with iterable categories, so filteredPlugins calls .filter() on undefined.

Impact

  • All tests still pass (711/711), but vitest reports it as an "Unhandled Error"
  • Could mask real failures in the future

Expected Fix

Ensure PluginMarketplace handles missing/undefined plugin registry gracefully (default to empty array), and/or update the WorkspacePanel test mocks to return the expected shape.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions