|
|
@@ -169,6 +169,25 @@ class ClasspathOutlookExamSprintReportRendererTest {
|
|
|
.containsPattern("<text class='chart-axis-tick-label chart-axis-tick-label-y' x='26' y='54' text-anchor='end' fill='#7f8b97' font-size='11'>5</text>");
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 覆盖科学备考建议频率卡片的线性进度条时,应使用 PDF 友好的 SVG 几何图形,避免 CSS 圆角裁剪在 PDF 中变尖。
|
|
|
+ */
|
|
|
+ @Test
|
|
|
+ void renderUsesSvgLinearProgressBarsForFrequencyPlanCards() throws Exception {
|
|
|
+ ClasspathOutlookExamSprintReportRenderer renderer = new ClasspathOutlookExamSprintReportRenderer(OBJECT_MAPPER);
|
|
|
+
|
|
|
+ String html = renderer.render(unmodeledOutlookContent(callerVocabularyPayload()), Instant.parse("2026-01-03T08:00:00Z"));
|
|
|
+
|
|
|
+ assertThat(html)
|
|
|
+ .contains("<svg class='freq-progress-svg'")
|
|
|
+ .contains("viewBox='0 0 100 8'")
|
|
|
+ .contains("preserveAspectRatio='none'")
|
|
|
+ .contains("<clipPath id='freq-progress-clip-1' clipPathUnits='userSpaceOnUse'>")
|
|
|
+ .contains("<rect x='0' y='0' width='100' height='8' rx='4' ry='4' fill='#dfe6ef'/>")
|
|
|
+ .contains("<rect x='0' y='0' width='72' height='8' fill='#2c8cff' clip-path='url(#freq-progress-clip-2)'/>")
|
|
|
+ .doesNotContain("<div class='freq-progress'><span style='width:");
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 覆盖官方上游词汇 payload 渲染所有内联 SVG 时,每个 SVG 起始标签都应声明 Batik 可识别的 CJK 字体族。
|
|
|
*/
|
|
|
@@ -183,8 +202,9 @@ class ClasspathOutlookExamSprintReportRendererTest {
|
|
|
.contains("<svg class='past-paper-column-chart' font-family=\"'MiSans VF', MiSans, ReportFont, sans-serif\"")
|
|
|
.contains("<svg class='high-frequency-column-chart' font-family=\"'MiSans VF', MiSans, ReportFont, sans-serif\"")
|
|
|
.contains("<svg class='frequency-band-column-chart' font-family=\"'MiSans VF', MiSans, ReportFont, sans-serif\"")
|
|
|
+ .contains("<svg class='freq-progress-svg' font-family=\"'MiSans VF', MiSans, ReportFont, sans-serif\"")
|
|
|
.contains("<svg font-family=\"'MiSans VF', MiSans, ReportFont, sans-serif\" xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 260'");
|
|
|
- assertThat(svgStartTags(html)).hasSize(5).allSatisfy(svg -> assertThat(svg).contains(SVG_CJK_FONT_FAMILY));
|
|
|
+ assertThat(svgStartTags(html)).hasSize(8).allSatisfy(svg -> assertThat(svg).contains(SVG_CJK_FONT_FAMILY));
|
|
|
}
|
|
|
|
|
|
/**
|