fix: 產出格式修正
This commit is contained in:
@@ -30,6 +30,12 @@ test('CLI runs doctor and scan against one prototype', async () => {
|
||||
| --- | --- | --- |
|
||||
| [\`index.html\`](index.html) | \`legacy/index.jsp\` | Customer portal entry |
|
||||
`)
|
||||
await mkdir(join(cwd, '.playwright'), { recursive: true })
|
||||
await writeFile(join(cwd, '.playwright/cli.config.json'), JSON.stringify({
|
||||
browser: {
|
||||
browserName: 'chromium'
|
||||
}
|
||||
}, null, 2))
|
||||
|
||||
const doctor = await exec('node', [cli, 'doctor'], { cwd })
|
||||
await exec('node', [cli, 'scan'], { cwd })
|
||||
@@ -59,7 +65,6 @@ test('CLI runs doctor and scan against one prototype', async () => {
|
||||
assert.equal(appMap.routes[0].evidence.recommendedTemplate, undefined)
|
||||
assert.equal(appMap.routes[0].guide.legacyJsp, 'legacy/index.jsp')
|
||||
assert.equal(appMap.routes[0].guide.description, 'Customer portal entry')
|
||||
assert.equal(appMap.guideSources[0].source, 'portal.md')
|
||||
})
|
||||
|
||||
function pick(object, keys) {
|
||||
|
||||
+2
-7
@@ -131,7 +131,7 @@ test('validatePageContract reports evidence mismatches', () => {
|
||||
assert.match(report.warnings.join('\n'), /Save/)
|
||||
})
|
||||
|
||||
test('buildAppMap classifies auth, shell references, and feature pages', () => {
|
||||
test('buildAppMap only keeps AI-implementable auth and feature pages', () => {
|
||||
const prototypeDir = '/repo/prototype'
|
||||
const specs = [
|
||||
buildSpec('/repo/prototype/portal/login.html', '<main><input type="password" name="pwd"><button>登入</button></main>'),
|
||||
@@ -146,11 +146,9 @@ test('buildAppMap classifies auth, shell references, and feature pages', () => {
|
||||
assert.equal(buildAppMap([
|
||||
buildSpec('/repo/prototype/portal/forget-password.html', '<main><h1>忘記密碼</h1><input name="idno"><button>發送至信箱</button></main>')
|
||||
], prototypeDir).routes[0].targetRole, 'forgot-password')
|
||||
assert.equal(appMap.routes.find((route) => route.prototype === 'portal/app-layout.html').kind, 'legacy-shell-reference')
|
||||
assert.equal(appMap.routes.find((route) => route.prototype === 'portal/app-layout.html').usePrototypeContent, false)
|
||||
assert.equal(appMap.routes.find((route) => route.prototype === 'portal/app-layout.html'), undefined)
|
||||
assert.equal(appMap.routes.find((route) => route.prototype === 'venue/applications-list.html').kind, 'feature-page')
|
||||
assert.equal(appMap.routes.find((route) => route.prototype === 'venue/applications-list.html').layout, 'template-app')
|
||||
assert.equal(appMap.modules.find((module) => module.name === 'venue').kind, 'feature-module')
|
||||
})
|
||||
|
||||
test('buildAppMap enriches routes with prototype markdown guide entries', () => {
|
||||
@@ -177,13 +175,10 @@ test('buildAppMap enriches routes with prototype markdown guide entries', () =>
|
||||
], prototypeDir, [guide])
|
||||
const route = appMap.routes[0]
|
||||
|
||||
assert.equal(appMap.guideSources[0].source, 'venue.md')
|
||||
assert.equal(route.evidence.prototypeGuide, 'venue.md')
|
||||
assert.equal(route.guide.legacyJsp, 'zte_pro/zte451_02.jsp + zte451_02_1.jsp')
|
||||
assert.equal(route.guide.legacyPb, 'n_zte451.of_zte451_02 / of_zte451_02_1')
|
||||
assert.equal(route.guide.targetView, 'RoomQueryView.vue')
|
||||
assert.equal(appMap.guideSources[0].legacyFlowCount, 1)
|
||||
assert.equal(appMap.legacyFlows[0].tasks[0], '場地查詢')
|
||||
assert.equal(route.guide.flowRefs[0].tasks[0], '場地查詢')
|
||||
assert.deepEqual(route.guide.flowRefs[0].matchedKeys, ['zte451_02.jsp', 'of_zte451_02', 'zte451_02_1.jsp', 'of_zte451_02_1'])
|
||||
assert.equal(route.guide.flowRefs[0].nodes[0].nodeType, 'query')
|
||||
|
||||
Reference in New Issue
Block a user