@@ -3,10 +3,7 @@ import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'nod
33import os from 'node:os'
44import path from 'node:path'
55import { fileURLToPath } from 'node:url'
6- import { createElement } from 'react'
7- import { renderToStaticMarkup } from 'react-dom/server'
86import { afterAll , expect , test } from 'vitest'
9- import { findingFingerprint } from '#control-analysis/review-ledger'
107import { ciRefs , warningExitCode } from '#design-conformance/ci'
118import { repositoryRoot } from '#design-conformance/command'
129import { ConformanceLinter } from '#design-conformance/conformance'
@@ -630,54 +627,6 @@ test('nested CVA condition arrays finish within the real CLI timeout and remain
630627 ) . toBe ( true )
631628} , 25_000 )
632629
633- test . each ( [
634- [ 'grid line integer' , 'gridColumnStart' , 'grid-column-start' , '1' , 1 , '' ] ,
635- [ 'grid row integer' , 'gridRowEnd' , 'grid-row-end' , '3' , 3 , '' ] ,
636- [ 'animation count' , 'animationIterationCount' , 'animation-iteration-count' , '2' , 2 , '' ] ,
637- [ 'border image ratio' , 'borderImageSlice' , 'border-image-slice' , '2' , 2 , '' ] ,
638- [ 'vendor line clamp' , 'WebkitLineClamp' , '-webkit-line-clamp' , '2' , 2 , '' ] ,
639- [ 'font weight' , 'fontWeight' , 'font-weight' , '600' , 600 , '' ] ,
640- [ 'ordinary dimension' , 'width' , 'width' , '1' , 1 , '' ] ,
641- [ 'numeric string dimension' , 'width' , 'width' , "'1'" , '1' , '' ] ,
642- [ 'numeric alias dimension' , 'height' , 'height' , 'size' , 4 , 'const size=4;' ] ,
643- [ 'string member dimension' , 'height' , 'height' , 'sizes.small' , '4' , "const sizes={small:'4'};" ] ,
644- [ 'typed grid alias' , 'gridColumnEnd' , 'grid-column-end' , 'line' , 2 , 'const line=2 as const;' ] ,
645- [ 'numeric custom variable' , '--reserve' , '--reserve' , '1' , 1 , '' ] ,
646- ] as const ) (
647- 'React numeric style serialization survives the real CLI: %s' ,
648- ( _name , property , cssProperty , value , runtimeValue , prefix ) => {
649- const { repo } = fixture ( )
650- writeFileSync ( path . join ( repo , ui ) , 'const A=()=> <button/>' )
651- const base = commit ( repo )
652- writeFileSync (
653- path . join ( repo , ui ) ,
654- `${ prefix } const A=()=> <button style={{'${ property } ':${ value } }}/>`
655- )
656- const result = run ( [
657- '--repo' ,
658- repo ,
659- '--base' ,
660- base ,
661- '--working-tree' ,
662- '--policy' ,
663- 'appearance' ,
664- '--format' ,
665- 'json' ,
666- ] )
667- expect ( result . status , result . stderr ) . toBe ( 1 )
668- const report = JSON . parse ( result . stdout ) as Report
669- expect ( report . status ) . toBe ( 'completed' )
670- const rendered = renderToStaticMarkup (
671- createElement ( 'button' , { style : { [ property ] : runtimeValue } } )
672- )
673- const reactValue = rendered . match ( / s t y l e = " [ ^ : " ] + : ( [ ^ " ] * ) " / ) ?. [ 1 ]
674- expect ( reactValue ) . toBeTypeOf ( 'string' )
675- expect ( report . findings . find ( ( finding ) => finding . property === cssProperty ) ?. value ) . toBe (
676- JSON . stringify ( [ reactValue ] )
677- )
678- }
679- )
680-
681630test ( 'central numeric-looking style references keep their scalar type ambiguity explicit through the real CLI' , ( ) => {
682631 const { repo } = fixture ( )
683632 mkdirSync ( path . join ( repo , 'packages/emcn/src' ) , { recursive : true } )
@@ -901,31 +850,6 @@ test.each([
901850 30_000
902851)
903852
904- test ( 'external review decisions annotate but never remove a diff finding' , ( ) => {
905- const { repo, base } = fixture ( )
906- const args = [ '--repo' , repo , '--base' , base , '--format' , 'json' ]
907- const raw = JSON . parse ( run ( args ) . stdout ) as Report
908- const reviews = path . join ( temp , 'reviews.json' )
909- const decision = JSON . stringify ( {
910- version : '1.0.0' ,
911- entries : [
912- {
913- fingerprint : findingFingerprint ( raw . findings [ 0 ] ) ,
914- status : 'retained-extra' ,
915- rationale : 'Reviewed test treatment' ,
916- evidence : '/external/review' ,
917- } ,
918- ] ,
919- } )
920- writeFileSync ( reviews , decision )
921- const annotated = JSON . parse ( run ( [ ...args , '--reviews' , reviews ] ) . stdout ) as Report
922- expect ( annotated . findings ) . toEqual ( raw . findings )
923- expect ( annotated . reviewDecisions ?. matches ) . toHaveLength ( 1 )
924- const internal = path . join ( repo , 'reviews.json' )
925- writeFileSync ( internal , decision )
926- expect ( run ( [ ...args , '--reviews' , internal ] ) . status ) . toBe ( 2 )
927- } )
928-
929853test ( 'landing and docs edits stay out of the diff while product reuse restores helper checks' , ( ) => {
930854 const repo = mkdtempSync ( path . join ( temp , 'scope-' ) )
931855 git ( repo , [ 'init' , '-q' ] )
0 commit comments