@@ -11,6 +11,43 @@ describe('directive', function () {
11
11
$rootScope = _$rootScope_ ;
12
12
} ) ) ;
13
13
14
+ it ( 'header rows are visible but offscreen' , function ( ) {
15
+ var markup = [
16
+ '<table wt-responsive-table>' ,
17
+ ' <thead>' ,
18
+ ' <tr>' ,
19
+ ' <th>First title</th>' ,
20
+ ' <th>Second title</th>' ,
21
+ ' <th>Third title</th>' ,
22
+ ' <th>Forth title</th>' ,
23
+ ' </tr>' ,
24
+ ' </thead>' ,
25
+ ' <tbody>' ,
26
+ ' <tr>' ,
27
+ ' <td>First column</td>' ,
28
+ ' <td>Second column</td>' ,
29
+ ' <td>Third column</td>' ,
30
+ ' <td>Forth column</td>' ,
31
+ ' </tr>' ,
32
+ ' <tr>' ,
33
+ ' <td>First column</td>' ,
34
+ ' <td>Second column</td>' ,
35
+ ' <td>Third column</td>' ,
36
+ ' <td>Forth column</td>' ,
37
+ ' </tr>' ,
38
+ ' </tbody>' ,
39
+ '</table>'
40
+ ] . join ( '' ) ;
41
+ var element = angular . element ( markup ) ;
42
+ document . body . appendChild ( element [ 0 ] ) ;
43
+ $compile ( element ) ;
44
+ $rootScope . $digest ( ) ;
45
+
46
+ var headerRow = element . find ( 'tr th' ) ;
47
+ expect ( headerRow . is ( ':visible' ) ) . toBe ( true ) ;
48
+ expect ( headerRow . is ( ':offscreen' ) ) . toBe ( true ) ;
49
+ } ) ;
50
+
14
51
it ( 'supports rows with no <thead>' , function ( ) {
15
52
var markup = [
16
53
'<table wt-responsive-table>' ,
@@ -43,7 +80,6 @@ describe('directive', function () {
43
80
expect ( headerRow . eq ( 1 ) . attr ( 'data-title' ) ) . toBeUndefined ( ) ;
44
81
expect ( headerRow . eq ( 2 ) . attr ( 'data-title' ) ) . toBeUndefined ( ) ;
45
82
expect ( headerRow . eq ( 3 ) . attr ( 'data-title' ) ) . toBeUndefined ( ) ;
46
- expect ( headerRow . is ( ':visible' ) ) . toBe ( true ) ;
47
83
} ) ;
48
84
49
85
it ( 'supports colspan' , function ( ) {
0 commit comments