test: remove manifest inventories and one profile policy sample (#41648)

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
This commit is contained in:
OrcaWin
2026-11-12 13:06:44 -08:00
committed by GitHub
co-authored by OrcaWin
parent 45dfd93499
commit 918bbcbe6e
3 changed files with 1 additions and 81 deletions
@@ -6603,7 +6603,6 @@
"src/shared/plugins/contributions/plugin-command-replaces.test.ts": 230,
"src/shared/plugins/contributions/plugin-content-pack-contributions.test.ts": 227,
"src/shared/plugins/contributions/plugin-custom-editor-contribution.test.ts": 238,
"src/shared/plugins/contributions/plugin-execution-profile.test.ts": 164,
"src/shared/plugins/contributions/plugin-panel-contribution.test.ts": 240,
"src/shared/plugins/contributions/plugin-status-bar-item-contribution.test.ts": 232,
"src/shared/plugins/declarative/plugin-declarative-catalog-rich.test.ts": 147,
@@ -1,26 +0,0 @@
import { describe, expect, it } from 'vitest'
import { PLUGIN_MANIFEST_V2_SINCE } from '../manifest/plugin-schema-field-docs'
import { parsePluginManifest } from '../manifest/plugin-manifest'
function manifestInput(): Record<string, unknown> {
return {
manifestVersion: 2,
execution: 'data',
id: 'demo',
publisher: 'samples',
name: 'Demo',
version: '1.2.0',
engines: { orca: `>=${PLUGIN_MANIFEST_V2_SINCE}` }
}
}
describe('execution profiles', () => {
it('rejects v2 contributions beyond the declared profile', () => {
const parsed = parsePluginManifest({
...manifestInput(),
execution: 'data',
contributes: { commands: [{ id: 'open', title: 'Open', action: 'view.tasks' }] }
})
expect(parsed).toMatchObject({ ok: false, error: expect.stringContaining('execution') })
})
})
@@ -1,6 +1,5 @@
import { describe, expect, it } from 'vitest'
import { PLUGIN_MANIFEST_V2_SINCE } from './plugin-schema-field-docs'
import { PLUGIN_COMMAND_LIMIT, parsePluginManifest, pluginManifestSchema } from './plugin-manifest'
import { parsePluginManifest } from './plugin-manifest'
function manifest(overrides: Record<string, unknown> = {}): Record<string, unknown> {
return {
@@ -54,56 +53,4 @@ describe('pluginManifestSchema boundaries', () => {
}
})
})
it('refuses format 1 names in format 2', () => {
const result = parsePluginManifest({
...manifest({ capabilities: [{ kind: 'storage' }] }),
manifestVersion: 2,
execution: 'data',
engines: { orca: `>=${PLUGIN_MANIFEST_V2_SINCE}` }
})
expect(result.ok).toBe(false)
})
it('rejects duplicate contribution ids', () => {
const parsed = pluginManifestSchema.safeParse(
manifest({
main: 'main.mjs',
contributes: {
panels: [
{ id: 'dashboard', title: 'One', entry: 'one.html' },
{ id: 'dashboard', title: 'Two', entry: 'two.html' }
],
commands: [
{ id: 'run', title: 'One' },
{ id: 'run', title: 'Two' }
],
events: []
}
})
)
expect(parsed.success).toBe(false)
if (!parsed.success) {
expect(parsed.error.issues.map((issue) => issue.message)).toEqual(
expect.arrayContaining(['duplicate panels id: dashboard', 'duplicate commands id: run'])
)
}
})
it('caps contribution arrays before they reach renderer or worker registries', () => {
const commands = Array.from({ length: PLUGIN_COMMAND_LIMIT + 1 }, (_, index) => ({
id: `command-${index}`,
title: `Command ${index}`
}))
expect(
parsePluginManifest(
manifest({
main: 'main.mjs',
contributes: { panels: [], commands, events: [] }
})
).ok
).toBe(false)
})
})