fix(web): restore travel detail child component styles

This commit is contained in:
caoxiaozhu
2026-06-22 13:34:12 +08:00
parent 103f225f54
commit 1b04ee1c4c
7 changed files with 669 additions and 0 deletions

View File

@@ -119,6 +119,10 @@ const stageRiskAdviceStyles = readFileSync(
fileURLToPath(new URL('../src/assets/styles/components/stage-risk-advice-card.css', import.meta.url)),
'utf8'
)
const detailHeroTemplate = readFileSync(
fileURLToPath(new URL('../src/components/travel/TravelRequestDetailHero.vue', import.meta.url)),
'utf8'
)
const relatedApplicationCardTemplate = readFileSync(
fileURLToPath(new URL('../src/components/travel/TravelRequestRelatedApplicationCard.vue', import.meta.url)),
'utf8'
@@ -1055,6 +1059,21 @@ test('related application information is shown above expense details for reimbur
assert.doesNotMatch(detailViewTemplate, /v-model="detailNoteEditorView"/)
})
test('split detail page header cards keep their scoped styles', () => {
assert.match(
detailHeroTemplate,
/<style scoped src="\.\.\/\.\.\/assets\/styles\/components\/travel-request-detail-hero\.css"><\/style>/
)
assert.match(
progressCardTemplate,
/<style scoped src="\.\.\/\.\.\/assets\/styles\/components\/travel-request-progress-card\.css"><\/style>/
)
assert.match(
relatedApplicationCardTemplate,
/<style scoped src="\.\.\/\.\.\/assets\/styles\/components\/travel-request-related-application-card\.css"><\/style>/
)
})
test('detail note model is retained for risk override persistence', () => {
assert.match(detailViewScript, /const canEditDetailNote = computed\(\(\) => isDraftRequest\.value\)/)
assert.match(detailViewScript, /function normalizeDetailNoteDraftValue\(value\)/)