Files
deepseek-harness/packages/experimental/schedule-bundle/tests/patch.spec.ts
T
ZiyaZhang 912e5bafa1 refactor(schedule-bundle): give the Schedule rows the usual per-row switches
The bundle no longer declares `dsh.bundle.rowSwitches`, so its page offers a
switch per row while it is on, as every other bundle does. The README records
that the three rows work only together, and the Agent Note records the
rejected lock.
2026-09-25 07:50:15 -07:00

48 lines
2.0 KiB
TypeScript

/** The experimental Schedule bundle inserts the three Schedule rows the shipped Web composition leaves out. */
import { readFileSync } from 'node:fs'
import { resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import { describe, expect, it } from 'vitest'
import * as yaml from 'js-yaml'
import { entryListSchema } from '@deepseek-ai/cordis-plugin-include'
const root = fileURLToPath(new URL('..', import.meta.url))
interface Manifest {
name?: string
icon?: string
private?: boolean
publishConfig?: { access?: string }
exports?: Record<string, unknown>
dependencies?: Record<string, string>
dsh?: { bundle?: { patch?: string } }
}
describe('experimental Schedule bundle', () => {
const manifest = JSON.parse(readFileSync(resolve(root, 'package.json'), 'utf8')) as Manifest
it('publishes as an experimental bundle with plugin-manager display metadata', () => {
expect(manifest.name).toBe('@deepseek-ai/dsh-experimental-schedule-bundle')
expect(manifest.private).toBeUndefined()
expect(manifest.publishConfig?.access).toBe('public')
expect(manifest.icon).toBe('./icon.svg')
expect(manifest.dsh?.bundle?.patch).toBe('./cordis.patch.yml')
expect(manifest.exports?.['./locale/*.json']).toBe('./locale/*.json')
expect(manifest.exports?.['./cordis.patch.yml']).toBe('./cordis.patch.yml')
// Each inserted row names a package the bundle depends on, so the rows resolve from the bundle.
expect(Object.keys(manifest.dependencies ?? {}).sort()).toEqual([
'@deepseek-ai/dsh-client-ui-schedule', '@deepseek-ai/dsh-schedule', '@deepseek-ai/dsh-time-context',
])
})
it('inserts the three Schedule rows switched on', () => {
const parsed = yaml.load(readFileSync(resolve(root, './cordis.patch.yml'), 'utf8'), { schema: entryListSchema })
expect(parsed).toEqual([{ insert: [
{ id: 'time-context', name: '@deepseek-ai/dsh-time-context' },
{ id: 'schedule', name: '@deepseek-ai/dsh-schedule' },
{ id: 'ui-schedule', name: '@deepseek-ai/dsh-client-ui-schedule' },
] }])
})
})