1- import { Component , DebugElement , EventEmitter , signal , Type , WritableSignal } from '@angular/core' ;
1+ import { Component , DebugElement , signal , Type , WritableSignal } from '@angular/core' ;
22import { CdkRadioButton , CdkRadioGroup } from './radio' ;
33import { ComponentFixture , TestBed } from '@angular/core/testing' ;
44import { By } from '@angular/platform-browser' ;
@@ -79,7 +79,7 @@ async function runAccessibilityChecks(root: HTMLElement): Promise<void> {
7979
8080describe ( 'CdkRadioGroup' , ( ) => {
8181 let fixture : ComponentFixture < RadioGroupExample > ;
82- let textDirection = new EventEmitter < Direction > ( ) ;
82+ let textDirection = signal ( 'ltr' ) ;
8383
8484 let radioGroup : DebugElement ;
8585 let radioButtons : DebugElement [ ] ;
@@ -111,7 +111,7 @@ describe('CdkRadioGroup', () => {
111111 providers : [
112112 {
113113 provide : Directionality ,
114- useValue : { value : 'ltr' , change : textDirection } ,
114+ useFactory : ( ) => ( { valueSignal : textDirection } ) ,
115115 } ,
116116 ] ,
117117 imports : [ BidiModule , component ] ,
@@ -120,6 +120,7 @@ describe('CdkRadioGroup', () => {
120120 const fixture = TestBed . createComponent < T > ( component ) ;
121121 fixture . detectChanges ( ) ;
122122 defineTestVariables ( fixture ) ;
123+ textDirection . set ( 'ltr' ) ;
123124 return fixture ;
124125 }
125126
@@ -171,7 +172,7 @@ describe('CdkRadioGroup', () => {
171172 } ) ;
172173 }
173174 if ( opts ?. textDirection !== undefined ) {
174- textDirection . emit ( opts . textDirection ) ;
175+ textDirection . set ( opts . textDirection ) ;
175176 }
176177 fixture . detectChanges ( ) ;
177178 defineTestVariables ( fixture ) ; // Ensure env vars are up-to-date with the dom.
@@ -502,16 +503,14 @@ describe('CdkRadioGroup', () => {
502503 } ) ;
503504
504505 describe ( 'text direction rtl' , ( ) => {
505- beforeEach ( ( ) => setupRadioGroup ( { textDirection : 'rtl' } ) ) ;
506+ beforeEach ( ( ) => setupRadioGroup ( { textDirection : 'rtl' , orientation : 'horizontal' } ) ) ;
506507
507508 it ( 'should move focus to the next radio button on ArrowLeft' , ( ) => {
508- setupRadioGroup ( { orientation : 'horizontal' } ) ;
509509 left ( ) ;
510510 expect ( isFocused ( 1 ) ) . toBe ( true ) ;
511511 } ) ;
512512
513513 it ( 'should move focus to the previous radio button on ArrowRight' , ( ) => {
514- setupRadioGroup ( { orientation : 'horizontal' } ) ;
515514 left ( ) ;
516515 left ( ) ;
517516 right ( ) ;
@@ -522,7 +521,6 @@ describe('CdkRadioGroup', () => {
522521 setupRadioGroup ( {
523522 skipDisabled : true ,
524523 disabledOptions : [ 1 , 2 ] ,
525- orientation : 'horizontal' ,
526524 } ) ;
527525 left ( ) ;
528526 expect ( isFocused ( 3 ) ) . toBe ( true ) ;
0 commit comments