@@ -200,21 +200,24 @@ it('preserves helper switch selection conditions', async () => {
200200 expect ( report . flagged ) . toBe ( true )
201201} )
202202
203- it ( 'preserves the audited Object.entries reducer to fromEntries refactor' , async ( ) => {
204- const before =
205- 'export const copy=(blocks)=>Object.entries(blocks).reduce((acc,[id,block])=>({...acc,[id]:{...block,value:structuredClone(block.value)}}),{})'
206- const after =
207- 'export const copy=(blocks)=>Object.fromEntries(Object.entries(blocks).map(([id,block])=>[id,{...block,value:structuredClone(block.value)}]))'
208- const report = await compareFiles (
209- {
210- [ data ] : before ,
211- [ view ] : 'import {copy} from "./data";export const Page=()=> <Panel data={copy(blocks)}/>' ,
212- } ,
213- { [ data ] : after } ,
214- settings
215- )
216- expect ( report . flagged ) . toBe ( false )
217- } )
203+ it . each ( [ 1 , 24 ] ) (
204+ 'preserves the audited record-map refactor at resolution depth %s' ,
205+ async ( resolutionDepth ) => {
206+ const before =
207+ 'export const copy=(blocks)=>Object.entries(blocks).reduce((acc,[id,block])=>({...acc,[id]:{...block,value:structuredClone(block.value)}}),{})'
208+ const after =
209+ 'export const copy=(blocks)=>Object.fromEntries(Object.entries(blocks).map(([id,block])=>[id,{...block,value:structuredClone(block.value)}]))'
210+ const report = await compareFiles (
211+ {
212+ [ data ] : before ,
213+ [ view ] : 'import {copy} from "./data";export const Page=()=> <Panel data={copy(blocks)}/>' ,
214+ } ,
215+ { [ data ] : after } ,
216+ { ...settings , limits : { ...settings . limits , resolutionDepth } }
217+ )
218+ expect ( report . flagged ) . toBe ( false )
219+ }
220+ )
218221
219222it ( 'keeps selected environment evidence narrow after exhausting expression depth' , async ( ) => {
220223 const source = ( size : number ) =>
@@ -284,3 +287,15 @@ it('leaves type queries over literal constants erased and parseable', async () =
284287 . some ( ( reason ) => / p a r s e r | e x t r a c t i o n f a i l e d / i. test ( reason ) )
285288 ) . toBe ( false )
286289} )
290+
291+ it ( 'preserves value/type names shared by generated schema declarations' , async ( ) => {
292+ const source = ( text : string ) =>
293+ `const Kind={ONE:1};type Kind=typeof Kind;export const Page=()=> <div>${ text } </div>`
294+ const report = await compareFiles ( { [ view ] : source ( 'a' ) } , { [ view ] : source ( 'b' ) } , settings )
295+ expect ( report . flagged ) . toBe ( true )
296+ expect (
297+ report . findings
298+ . flatMap ( ( finding ) => finding . limitations )
299+ . some ( ( reason ) => / p a r s e r | e x t r a c t i o n f a i l e d / i. test ( reason ) )
300+ ) . toBe ( false )
301+ } )
0 commit comments