File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -811,7 +811,7 @@ describe("selectHybridAccountTraced", () => {
811811 ) ;
812812 } ) ;
813813
814- it ( "falls back to least-recently-used when no accounts are available" , ( ) => {
814+ it ( "returns null when no accounts are available (AUDIT-H2 contract) " , ( ) => {
815815 const now = Date . now ( ) ;
816816 const accounts : AccountWithMetrics [ ] = [
817817 { index : 0 , isAvailable : false , lastUsed : now - 1_000 } ,
@@ -822,9 +822,12 @@ describe("selectHybridAccountTraced", () => {
822822 healthTracker : new HealthScoreTracker ( ) ,
823823 tokenTracker : new TokenBucketTracker ( ) ,
824824 } ) ;
825+ // AUDIT-H2 / D-01: trace variant mirrors production null-contract so
826+ // `why-selected` diagnostics match actual selection behaviour. The
827+ // old LRU fallback was removed in PR #397.
825828 expect ( result . availableCount ) . toBe ( 0 ) ;
826- expect ( result . selected ?. index ) . toBe ( 1 ) ;
827- expect ( result . selectionReason ) . toMatch ( / l e a s t - r e c e n t l y - u s e d / i) ;
829+ expect ( result . selected ) . toBeNull ( ) ;
830+ expect ( result . selectionReason ) . toMatch ( / a l l a c c o u n t s u n a v a i l a b l e / i) ;
828831 for ( const candidate of result . candidates ) {
829832 expect ( candidate . reason ) . toMatch ( / u n a v a i l a b l e / i) ;
830833 }
You can’t perform that action at this time.
0 commit comments