feat(plugins): merge Skill management into plugins
This commit is contained in:
@@ -6,19 +6,19 @@ import {
|
||||
} from '@/pages/Plugins/plugin-workspace-query';
|
||||
|
||||
describe('plugin workspace URL state', () => {
|
||||
it('uses the hydrated project presence for a bare route default', () => {
|
||||
it('opens the cloud-backed available tab for a bare route', () => {
|
||||
expect(parsePluginWorkspaceSearch(new URLSearchParams(), true)).toEqual({
|
||||
scope: 'project', source: 'all', state: 'all', search: '', selectedKey: null,
|
||||
scope: 'all', source: 'all', state: 'available', search: '', selectedKey: null,
|
||||
});
|
||||
expect(parsePluginWorkspaceSearch(new URLSearchParams(), false)).toEqual({
|
||||
scope: 'all', source: 'all', state: 'all', search: '', selectedKey: null,
|
||||
scope: 'all', source: 'all', state: 'available', search: '', selectedKey: null,
|
||||
});
|
||||
});
|
||||
|
||||
it('normalizes unknown values and a project scope without a project', () => {
|
||||
const params = new URLSearchParams('scope=unknown&source=remote&state=broken&q=%20notes%20&plugin=notes');
|
||||
expect(parsePluginWorkspaceSearch(params, true)).toEqual({
|
||||
scope: 'project', source: 'all', state: 'all', search: 'notes', selectedKey: null,
|
||||
scope: 'all', source: 'all', state: 'available', search: 'notes', selectedKey: null,
|
||||
});
|
||||
expect(parsePluginWorkspaceSearch(new URLSearchParams('scope=project'), false).scope).toBe('all');
|
||||
});
|
||||
@@ -31,39 +31,44 @@ describe('plugin workspace URL state', () => {
|
||||
|
||||
expect(fallback).toEqual({
|
||||
filters: {
|
||||
scope: 'all', source: 'all', state: 'all', search: '', selectedKey: null,
|
||||
scope: 'all', source: 'all', state: 'available', search: '', selectedKey: null,
|
||||
},
|
||||
canonicalSearch: 'scope=all&source=all&state=all',
|
||||
canonicalSearch: 'scope=all&source=all&state=available',
|
||||
scopeFallback: true,
|
||||
});
|
||||
|
||||
const afterProjectAppears = resolvePluginWorkspaceSearch(new URLSearchParams(), true);
|
||||
expect(afterProjectAppears).toEqual({
|
||||
filters: {
|
||||
scope: 'project', source: 'all', state: 'all', search: '', selectedKey: null,
|
||||
scope: 'all', source: 'all', state: 'available', search: '', selectedKey: null,
|
||||
},
|
||||
canonicalSearch: 'scope=project&source=all&state=all',
|
||||
canonicalSearch: 'scope=all&source=all&state=available',
|
||||
scopeFallback: false,
|
||||
});
|
||||
});
|
||||
|
||||
it('round-trips canonical filters and source-qualified selection', () => {
|
||||
it('round-trips the installed tab and source-qualified selection', () => {
|
||||
const serialized = serializePluginWorkspaceSearch({
|
||||
scope: 'all',
|
||||
source: 'local',
|
||||
state: 'enabled',
|
||||
state: 'mine',
|
||||
search: ' web search ',
|
||||
selectedKey: 'local:makelore_web_search',
|
||||
});
|
||||
expect(serialized.toString()).toBe(
|
||||
'scope=all&source=local&state=enabled&q=web+search&plugin=local%3Amakelore_web_search',
|
||||
'scope=all&source=local&state=mine&q=web+search&plugin=local%3Amakelore_web_search',
|
||||
);
|
||||
expect(parsePluginWorkspaceSearch(serialized, true)).toEqual({
|
||||
scope: 'all',
|
||||
source: 'local',
|
||||
state: 'enabled',
|
||||
state: 'mine',
|
||||
search: 'web search',
|
||||
selectedKey: 'local:makelore_web_search',
|
||||
});
|
||||
});
|
||||
|
||||
it('maps historical hidden filters onto one of the two visible tabs', () => {
|
||||
expect(parsePluginWorkspaceSearch(new URLSearchParams('state=enabled'), true).state).toBe('mine');
|
||||
expect(parsePluginWorkspaceSearch(new URLSearchParams('state=all'), true).state).toBe('available');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user