1
1
import { Component } from '@angular/core' ;
2
2
import { async , ComponentFixture , TestBed } from '@angular/core/testing' ;
3
+
4
+ import { getTableTextColumnMissingParentTableError } from './table-errors' ;
3
5
import { CdkTableModule } from './table-module' ;
4
6
import { expectTableToMatchContent } from './table.spec' ;
5
- import { TextColumnOptions , TEXT_COLUMN_OPTIONS } from './text-column' ;
6
- import { getTableTextColumnMissingParentTableError } from './table-errors' ;
7
+ import { TEXT_COLUMN_OPTIONS , TextColumnOptions } from './text-column' ;
8
+
7
9
8
10
describe ( 'CdkTextColumn' , ( ) => {
9
11
let fixture : ComponentFixture < BasicTextColumnApp > ;
10
12
let component : BasicTextColumnApp ;
11
13
let tableElement : HTMLElement ;
12
14
13
15
beforeEach ( async ( ( ) => {
14
- TestBed . configureTestingModule ( {
15
- imports : [ CdkTableModule ] ,
16
- declarations : [
17
- BasicTextColumnApp ,
18
- MissingTableApp ,
19
- ] ,
20
- } ) . compileComponents ( ) ;
16
+ TestBed
17
+ . configureTestingModule ( {
18
+ imports : [ CdkTableModule ] ,
19
+ declarations : [
20
+ BasicTextColumnApp ,
21
+ MissingTableApp ,
22
+ ] ,
23
+ } )
24
+ . compileComponents ( ) ;
21
25
} ) ) ;
22
26
23
27
beforeEach ( ( ) => {
@@ -38,8 +42,7 @@ describe('CdkTextColumn', () => {
38
42
39
43
it ( 'should throw an error if the text column is not in the content of a table' , ( ) => {
40
44
expect ( ( ) => TestBed . createComponent ( MissingTableApp ) . detectChanges ( ) )
41
- . toThrowError ( getTableTextColumnMissingParentTableError ( ) . message ) ;
42
-
45
+ . toThrowError ( getTableTextColumnMissingParentTableError ( ) . message ) ;
43
46
} ) ;
44
47
45
48
it ( 'should allow for alternate header text' , ( ) => {
@@ -89,21 +92,6 @@ describe('CdkTextColumn', () => {
89
92
] ) ;
90
93
} ) ;
91
94
92
- it ( 'should be able to justify the text' , ( ) => {
93
- component . justifyC = 'end' ;
94
- fixture . detectChanges ( ) ;
95
-
96
- const headerB = tableElement . querySelector ( 'th:nth-child(2' ) ! as HTMLElement ;
97
- const headerC = tableElement . querySelector ( 'th:nth-child(3' ) ! as HTMLElement ;
98
- expect ( headerB . style . textAlign ) . toBe ( 'start' ) ;
99
- expect ( headerC . style . textAlign ) . toBe ( 'end' ) ;
100
-
101
- const cellB = tableElement . querySelector ( 'td:nth-child(2' ) ! as HTMLElement ;
102
- const cellC = tableElement . querySelector ( 'td:nth-child(3' ) ! as HTMLElement ;
103
- expect ( cellB . style . textAlign ) . toBe ( 'start' ) ;
104
- expect ( cellC . style . textAlign ) . toBe ( 'end' ) ;
105
- } ) ;
106
-
107
95
describe ( 'with options' , ( ) => {
108
96
function createTestComponent ( options : TextColumnOptions < any > ) {
109
97
// Reset the previously configured testing module to be able set new providers.
0 commit comments