@@ -62,21 +62,21 @@ function getTableTemplate(defaultEnabled: boolean) {
62
62
<table ${ directives . table } mat-table [dataSource]="dataSource"
63
63
style="table-layout: fixed;">
64
64
<!-- Position Column -->
65
- <ng-container matColumnDef="position">
65
+ <ng-container matColumnDef="position" sticky >
66
66
<th mat-header-cell *matHeaderCellDef
67
67
${ directives . columnEnabled } [matResizableMaxWidthPx]="100"> No. </th>
68
68
<td mat-cell *matCellDef="let element"> {{element.position}} </td>
69
69
</ng-container>
70
70
71
71
<!-- Name Column -->
72
- <ng-container matColumnDef="name">
72
+ <ng-container matColumnDef="name" sticky >
73
73
<th mat-header-cell *matHeaderCellDef
74
74
${ directives . columnEnabled } [matResizableMinWidthPx]="150"> Name </th>
75
75
<td mat-cell *matCellDef="let element"> {{element.name}} </td>
76
76
</ng-container>
77
77
78
78
<!-- Weight Column (not resizable) -->
79
- <ng-container matColumnDef="weight">
79
+ <ng-container matColumnDef="weight" sticky >
80
80
<th mat-header-cell *matHeaderCellDef ${ directives . columnDisabled } >
81
81
Weight (Not resizable)
82
82
</th>
@@ -117,21 +117,21 @@ function getFlexTemplate(defaultEnabled: boolean) {
117
117
<div #table [dir]="direction">
118
118
<mat-table ${ directives . table } [dataSource]="dataSource">
119
119
<!-- Position Column -->
120
- <ng-container matColumnDef="position">
120
+ <ng-container matColumnDef="position" sticky >
121
121
<mat-header-cell *matHeaderCellDef
122
122
${ directives . columnEnabled } [matResizableMaxWidthPx]="100"> No. </mat-header-cell>
123
123
<mat-cell *matCellDef="let element"> {{element.position}} </mat-cell>
124
124
</ng-container>
125
125
126
126
<!-- Name Column -->
127
- <ng-container matColumnDef="name">
127
+ <ng-container matColumnDef="name" sticky >
128
128
<mat-header-cell *matHeaderCellDef
129
129
${ directives . columnEnabled } [matResizableMinWidthPx]="150"> Name </mat-header-cell>
130
130
<mat-cell *matCellDef="let element"> {{element.name}} </mat-cell>
131
131
</ng-container>
132
132
133
133
<!-- Weight Column (not resizable) -->
134
- <ng-container matColumnDef="weight">
134
+ <ng-container matColumnDef="weight" sticky >
135
135
<mat-header-cell *matHeaderCellDef ${ directives . columnDisabled } >
136
136
Weight (Not resizable)
137
137
</mat-header-cell>
@@ -178,6 +178,7 @@ abstract class BaseTestComponent {
178
178
}
179
179
180
180
getColumnOriginPosition ( index : number ) : number {
181
+ console . log ( index , this . getColumnElement ( index ) . offsetLeft ) ;
181
182
return this . getColumnElement ( index ) . offsetLeft + this . getColumnWidth ( index ) ;
182
183
}
183
184
@@ -323,24 +324,25 @@ const approximateMatcher = {
323
324
} ;
324
325
325
326
const testCases : ReadonlyArray < [ Type < object > , Type < BaseTestComponent > , string ] > = [
326
- [ MatColumnResizeModule , MatResizeTest , 'opt-in table-based mat-table' ] ,
327
+ /* [MatColumnResizeModule, MatResizeTest, 'opt-in table-based mat-table'],
327
328
[MatColumnResizeModule, MatResizeOnPushTest, 'inside OnPush component'],
328
329
[MatColumnResizeModule, MatResizeFlexTest, 'opt-in flex-based mat-table'],
329
330
[
330
331
MatDefaultEnabledColumnResizeModule, MatResizeDefaultTest,
331
332
'default enabled table-based mat-table'
332
333
],
333
- [
334
+ */ [
334
335
MatDefaultEnabledColumnResizeModule , MatResizeDefaultRtlTest ,
335
- 'default enabled rtl table-based mat-table' ] ,
336
- [
336
+ 'default enabled rtl table-based mat-table'
337
+ ] ,
338
+ /* [
337
339
MatDefaultEnabledColumnResizeModule, MatResizeDefaultFlexTest,
338
340
'default enabled flex-based mat-table'
339
341
],
340
342
[
341
343
MatDefaultEnabledColumnResizeModule, MatResizeDefaultFlexRtlTest,
342
344
'default enabled rtl flex-based mat-table'
343
- ] ,
345
+ ],*/
344
346
] ;
345
347
346
348
describe ( 'Material Popover Edit' , ( ) => {
@@ -400,10 +402,11 @@ describe('Material Popover Edit', () => {
400
402
expect ( component . getOverlayThumbElement ( 0 ) ) . toBeUndefined ( ) ;
401
403
} ) ) ;
402
404
403
- it ( 'resizes the target column via mouse input' , fakeAsync ( ( ) => {
405
+ fit ( 'resizes the target column via mouse input' , fakeAsync ( ( ) => {
404
406
const initialTableWidth = component . getTableWidth ( ) ;
405
407
const initialColumnWidth = component . getColumnWidth ( 1 ) ;
406
408
const initialColumnPosition = component . getColumnOriginPosition ( 1 ) ;
409
+ const initialNextColumnPosition = component . getColumnOriginPosition ( 2 ) ;
407
410
408
411
component . triggerHoverState ( ) ;
409
412
fixture . detectChanges ( ) ;
@@ -415,7 +418,9 @@ describe('Material Popover Edit', () => {
415
418
416
419
let thumbPositionDelta = component . getOverlayThumbPosition ( 1 ) - initialThumbPosition ;
417
420
let columnPositionDelta = component . getColumnOriginPosition ( 1 ) - initialColumnPosition ;
421
+ let nextColumnPositionDelta = component . getColumnOriginPosition ( 2 ) - initialNextColumnPosition ;
418
422
( expect ( thumbPositionDelta ) as any ) . isApproximately ( columnPositionDelta ) ;
423
+ ( expect ( nextColumnPositionDelta ) as any ) . isApproximately ( columnPositionDelta ) ;
419
424
420
425
( expect ( component . getTableWidth ( ) ) as any ) . isApproximately ( initialTableWidth + 5 ) ;
421
426
( expect ( component . getColumnWidth ( 1 ) ) as any ) . isApproximately ( initialColumnWidth + 5 ) ;
0 commit comments