@@ -36,74 +36,12 @@ describe('MatTabBody', () => {
36
36
} ) ;
37
37
} ) ) ;
38
38
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 ( ) ;
103
43
104
- expect ( fixture . componentInstance . tabBody . _position ) . toBe ( 'left-origin-center' ) ;
105
- } ) ;
106
- } ) ;
44
+ expect ( fixture . componentInstance . tabBody . _position ) . toBe ( 'center' ) ;
107
45
} ) ;
108
46
109
47
describe ( 'should properly set the position in LTR' , ( ) => {
@@ -213,14 +151,13 @@ describe('MatTabBody', () => {
213
151
@Component ( {
214
152
template : `
215
153
<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>
217
155
` ,
218
156
imports : [ PortalModule , MatRippleModule , MatTabBody ] ,
219
157
} )
220
158
class SimpleTabBodyApp implements AfterViewInit {
221
159
content = signal < TemplatePortal | undefined > ( undefined ) ;
222
160
position : number ;
223
- origin : number | null ;
224
161
225
162
@ViewChild ( MatTabBody ) tabBody : MatTabBody ;
226
163
@ViewChild ( TemplateRef ) template : TemplateRef < any > ;
0 commit comments