@@ -36,74 +36,12 @@ describe('MatTabBody', () => {
3636 } ) ;
3737 } ) ) ;
3838
39- describe ( 'when initialized as center' , ( ) => {
40- let fixture : ComponentFixture < SimpleTabBodyApp > ;
41-
42- it ( 'should be center position if origin is unchanged' , ( ) => {
43- fixture = TestBed . createComponent ( SimpleTabBodyApp ) ;
44- fixture . componentInstance . position = 0 ;
45- fixture . detectChanges ( ) ;
46-
47- expect ( fixture . componentInstance . tabBody . _position ) . toBe ( 'center' ) ;
48- } ) ;
49-
50- it ( 'should be center position if origin is explicitly set to null' , ( ) => {
51- fixture = TestBed . createComponent ( SimpleTabBodyApp ) ;
52- fixture . componentInstance . position = 0 ;
53-
54- // It can happen that the `origin` is explicitly set to null through the Angular input
55- // binding. This test should ensure that the body does properly such origin value.
56- // The `MatTab` class sets the origin by default to null. See related issue: #12455
57- fixture . componentInstance . origin = null ;
58- fixture . detectChanges ( ) ;
59-
60- expect ( fixture . componentInstance . tabBody . _position ) . toBe ( 'center' ) ;
61- } ) ;
62-
63- describe ( 'in LTR direction' , ( ) => {
64- beforeEach ( ( ) => {
65- dir = 'ltr' ;
66- fixture = TestBed . createComponent ( SimpleTabBodyApp ) ;
67- } ) ;
68- it ( 'should be left-origin-center position with negative or zero origin' , ( ) => {
69- fixture . componentInstance . position = 0 ;
70- fixture . componentInstance . origin = 0 ;
71- fixture . detectChanges ( ) ;
72-
73- expect ( fixture . componentInstance . tabBody . _position ) . toBe ( 'left-origin-center' ) ;
74- } ) ;
75-
76- it ( 'should be right-origin-center position with positive nonzero origin' , ( ) => {
77- fixture . componentInstance . position = 0 ;
78- fixture . componentInstance . origin = 1 ;
79- fixture . detectChanges ( ) ;
80-
81- expect ( fixture . componentInstance . tabBody . _position ) . toBe ( 'right-origin-center' ) ;
82- } ) ;
83- } ) ;
84-
85- describe ( 'in RTL direction' , ( ) => {
86- beforeEach ( ( ) => {
87- dir = 'rtl' ;
88- fixture = TestBed . createComponent ( SimpleTabBodyApp ) ;
89- } ) ;
90-
91- it ( 'should be right-origin-center position with negative or zero origin' , ( ) => {
92- fixture . componentInstance . position = 0 ;
93- fixture . componentInstance . origin = 0 ;
94- fixture . detectChanges ( ) ;
95-
96- expect ( fixture . componentInstance . tabBody . _position ) . toBe ( 'right-origin-center' ) ;
97- } ) ;
98-
99- it ( 'should be left-origin-center position with positive nonzero origin' , ( ) => {
100- fixture . componentInstance . position = 0 ;
101- fixture . componentInstance . origin = 1 ;
102- fixture . detectChanges ( ) ;
39+ it ( 'should be center position if origin is unchanged' , ( ) => {
40+ const fixture = TestBed . createComponent ( SimpleTabBodyApp ) ;
41+ fixture . componentInstance . position = 0 ;
42+ fixture . detectChanges ( ) ;
10343
104- expect ( fixture . componentInstance . tabBody . _position ) . toBe ( 'left-origin-center' ) ;
105- } ) ;
106- } ) ;
44+ expect ( fixture . componentInstance . tabBody . _position ) . toBe ( 'center' ) ;
10745 } ) ;
10846
10947 describe ( 'should properly set the position in LTR' , ( ) => {
@@ -213,14 +151,13 @@ describe('MatTabBody', () => {
213151@Component ( {
214152 template : `
215153 <ng-template>Tab Body Content</ng-template>
216- <mat-tab-body [content]="content()" [position]="position" [origin]="origin" ></mat-tab-body>
154+ <mat-tab-body [content]="content()" [position]="position"></mat-tab-body>
217155 ` ,
218156 imports : [ PortalModule , MatRippleModule , MatTabBody ] ,
219157} )
220158class SimpleTabBodyApp implements AfterViewInit {
221159 content = signal < TemplatePortal | undefined > ( undefined ) ;
222160 position : number ;
223- origin : number | null ;
224161
225162 @ViewChild ( MatTabBody ) tabBody : MatTabBody ;
226163 @ViewChild ( TemplateRef ) template : TemplateRef < any > ;
0 commit comments