test(web): expect three startup plugin batches in the keyless smoke

The application phase's map-form combo URL passes the 3 KiB limit once
the four settings companions join the composition, so the module system
partitions that phase into two combos beside the bootstrap one, as the
loading model allows. The smoke pins the three immutable batches and
still checks every combo's script, map, and cache header.
This commit is contained in:
Yichen Jiang committed 2026-09-19 10:46:51 +08:00
1 parent 9f3ddc1a19
commit 3bcac0b878
1 file changed
+9 -5
+9 -5
View File
@@ -309,7 +309,7 @@ const notReady = UI_PLUGIN_DIRS.filter((dir) => {
if (notReady.length > 0) console.warn(`[smoke-real] skipped — client bundles not ready: ${notReady.join(', ')}`)
describe('dsh web keyless CLI smoke', () => {
it('serves a usable app from two immutable plugin batches', async () => {
it('serves a usable app from three immutable plugin batches', async () => {
requireDist()
const sessionsDir = mkdtempSync(join(tmpdir(), 'dsh-web-keyless-'))
const tsxLoader = pathToFileURL(createRequire(join(REPO_ROOT, 'package.json')).resolve('tsx')).href
@@ -356,10 +356,13 @@ describe('dsh web keyless CLI smoke', () => {
await page.goto(readyUrl)
await page.getByRole('button', { name: 'New session', exact: true }).first().waitFor({ timeout: 30_000 })
const batchPaths = [...new Set(pluginScripts)].sort()
expect(batchPaths).toHaveLength(2)
expect(batchPaths).toContainEqual(expect.stringMatching(
/^\/plugins\/\?\?.+\/client\.js,.+\/client\.js&rev=[a-f\d]{12}$/,
))
// The bootstrap phase is the modules package alone; the application phase
// spans two combos because its map-form URL is over the 3 KiB combo limit
// since the four settings companions joined the composition.
expect(batchPaths).toHaveLength(3)
expect(batchPaths.filter(path => (
/^\/plugins\/\?\?.+\/client\.js,.+\/client\.js&rev=[a-f\d]{12}$/.test(path)
))).toHaveLength(2)
expect(batchPaths).toContainEqual(expect.stringMatching(
/^\/plugins\/\?\?@deepseek-ai\/dsh-client-modules\/client\.js&rev=[a-f\d]{12}$/,
))
@@ -367,6 +370,7 @@ describe('dsh web keyless CLI smoke', () => {
expect([...cacheHeaders.values()]).toEqual([
'public, max-age=31536000, immutable',
'public, max-age=31536000, immutable',
'public, max-age=31536000, immutable',
])
for (const path of batchPaths) {
const [scriptResponse, mapResponse] = await Promise.all([