mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-02 23:14:33 +01:00
test(review-depth): a quoted > on the style tag keeps an SVG code; plain style comments stay a drawing (GST-940, failing)
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
11222c2673
commit
8ad07db127
1 file changed
+8
@@ -159,11 +159,19 @@ describe('GST-911 misread 1: a chart SVG is data, an SVG that can run code is se
|
||||
['a character-reference comment in a style element', ' <style><!-- rect{fill:image-set("https://x.test/p.png" 1x)} --></style>'],
|
||||
['CSS after an HTML empty comment in a style element', ' <style><!-->rect{fill:image-set("https://x.test/p.png" 1x)}--></style>'],
|
||||
['CSS after an HTML --!> comment end in a style element', ' <style><!-- --!>rect{fill:image-set("https://x.test/p.png" 1x)} --></style>'],
|
||||
['a </style> inside a quoted style attribute', ' <style title="></style>">rect{fill:image-set("https://x.test/p.png" 1x)}</style>'],
|
||||
['an escaped ampersand in a style element', ' <style>text{font-family:"A & B"}</style>'],
|
||||
])('%s keeps the SVG code', (_name, line) => {
|
||||
const fx = fixture();
|
||||
expect(plan(fx, fx.commit({ 'results/chart.svg': chart(5, line) })).class).toBe('code');
|
||||
}, 60_000);
|
||||
|
||||
// Value: protects=the GST-940 style walker still reads a plain chart style as a drawing: a comment, CDATA and a quoted attribute
|
||||
// without markup; fails_when=the walker over-refuses them, so chart SVGs lose the light review; seam=svgDrawing
|
||||
test('a style comment, CDATA and quoted attribute keep a chart a drawing (GST-940)', () => {
|
||||
expect(svgDrawing(chart(5, ' <style type="text/css" media="all"><!-- plot --><![CDATA[ rect{fill:#000} ]]></style>'))).toBe(true);
|
||||
});
|
||||
|
||||
// Value: protects=a passive edit to an SVG that already carries a script is still code, because the whole file decides, not the
|
||||
// changed lines; and an SVG code names stays code like any consumed data file; fails_when=either plans as docs; seam=collectCommit
|
||||
test('an edit inside a scripted SVG, and an SVG code names, stay code', () => {
|
||||
|
||||
Reference in new issue
Block a user