@@ -551,6 +551,28 @@ describe('isDesignTokenChannelEnabled (PR-D env gate)', () => {
551551// run that whole pipeline (env gate → readDesignSystemAssets per
552552// root → fallback chain → DesignSystemAssets shape) end-to-end.
553553describe ( 'resolveDesignSystemAssets (PR-D server-layer asset resolution)' , ( ) => {
554+ it ( 'keeps a user-prefixed selection on the user-installed package root' , async ( ) => {
555+ clearDesignSystemAssetsCacheForTests ( ) ;
556+ const builtInRoot = fresh ( ) ;
557+ const userRoot = fresh ( ) ;
558+ writeDesignSystemProject ( builtInRoot , 'default' , {
559+ tokens : ':root { --authority: built-in; }' ,
560+ components : '<button class="built-in">Built-in fixture</button>' ,
561+ } ) ;
562+ writeDesignSystemProject ( userRoot , 'default' , {
563+ tokens : ':root { --authority: user; }' ,
564+ components : '<button class="user-installed">User fixture</button>' ,
565+ } ) ;
566+
567+ const assets = await resolveDesignSystemAssets ( 'user:default' , builtInRoot , userRoot , { } ) ;
568+
569+ expect ( assets . tokensCss ) . toBe ( ':root { --authority: user; }' ) ;
570+ expect ( assets . fixtureHtml ) . toBe (
571+ '<button class="user-installed">User fixture</button>' ,
572+ ) ;
573+ clearDesignSystemAssetsCacheForTests ( ) ;
574+ } ) ;
575+
554576 it ( 'returns the built-in assets when the channel is enabled (env unset, default-on)' , async ( ) => {
555577 const builtInRoot = fresh ( ) ;
556578 const userRoot = fresh ( ) ;
0 commit comments