import assert from "assert"; import { readFileSync } from "fs"; import { dirname, resolve } from "path"; import { fileURLToPath } from "url"; const scriptDir = dirname(fileURLToPath(import.meta.url)); const detailPagePath = resolve( scriptDir, "../src/pages/ChatMain/ChatLongAnswer/index.vue" ); const parsedValuePath = resolve( scriptDir, "../src/pages/ChatMain/ChatLongAnswer/ParsedValueView.vue" ); const detailStylePath = resolve( scriptDir, "../src/pages/ChatMain/ChatLongAnswer/styles/index.scss" ); const skeletonComponentPath = resolve( scriptDir, "../src/pages/ChatMain/ChatLongAnswer/LongAnswerSectionSkeleton.vue" ); const detailPageSource = readFileSync(detailPagePath, "utf8"); const parsedValueSource = readFileSync(parsedValuePath, "utf8"); const detailStyleSource = readFileSync(detailStylePath, "utf8"); const skeletonComponentSource = readFileSync(skeletonComponentPath, "utf8"); assert.match( detailPageSource, /const\s+streamFinished\s*=\s*ref/, "long answer page should track whether the forwarded stream has finished" ); assert.match( detailPageSource, /import\s+LongAnswerSectionSkeleton\s+from\s+"\.\/LongAnswerSectionSkeleton\.vue"/, "long answer page should use a sibling skeleton component" ); assert.doesNotMatch( detailPageSource, /DEFERRED_SPECIAL_SECTION_KEYS/, "long answer page should not use a special-key whitelist for section skeletons" ); assert.doesNotMatch( detailPageSource, /LONG_TEXT_KEYS\.(sceneImage|contentImage|spotLocate|questionSuggest|commodityList|photoList|aigcComponet)/, "section skeleton readiness should not be tied to named special keys" ); assert.match( detailPageSource, /