1
1
describe ( 'rowSearcher' , function ( ) {
2
- var grid , $scope , $compile , recompile ,
3
- rows , columns , rowSearcher , uiGridConstants , filter ;
2
+ var grid , rows , columns , rowSearcher , uiGridConstants , filter ;
4
3
5
4
beforeEach ( module ( 'ui.grid' ) ) ;
6
5
7
- beforeEach ( inject ( function ( _$compile_ , $rootScope , _rowSearcher_ , Grid , GridRow , GridColumn , _uiGridConstants_ ) {
8
- $scope = $rootScope ;
6
+ beforeEach ( inject ( function ( _rowSearcher_ , Grid , GridRow , GridColumn , _uiGridConstants_ ) {
9
7
rowSearcher = _rowSearcher_ ;
10
8
uiGridConstants = _uiGridConstants_ ;
11
9
@@ -40,39 +38,38 @@ describe('rowSearcher', function() {
40
38
}
41
39
42
40
afterEach ( function ( ) {
43
- // angular.element(grid).remove();
44
41
grid = null ;
45
42
} ) ;
46
43
47
44
describe ( 'guessCondition' , function ( ) {
48
45
it ( 'should create a RegExp when term ends with a *' , function ( ) {
49
46
var filter = { term : 'blah*' } ;
50
47
51
- var re = new RegExp ( / ^ b l a h [ \s \S ] * ?$ / i) ;
48
+ var re = new RegExp ( / ^ b l a h . * ?$ / i) ;
52
49
53
50
expect ( rowSearcher . guessCondition ( filter ) ) . toEqual ( re ) ;
54
51
} ) ;
55
52
56
53
it ( 'should create a RegExp when term starts with a *' , function ( ) {
57
54
var filter = { term : '*blah' } ;
58
55
59
- var re = new RegExp ( / ^ [ \s \S ] * ?b l a h $ / i) ;
56
+ var re = new RegExp ( / ^ . * ?b l a h $ / i) ;
60
57
61
58
expect ( rowSearcher . guessCondition ( filter ) ) . toEqual ( re ) ;
62
59
} ) ;
63
60
64
61
it ( 'should create a RegExp when term starts and ends with a *' , function ( ) {
65
62
var filter = { term : '*blah*' } ;
66
63
67
- var re = new RegExp ( / ^ [ \s \S ] * ?b l a h [ \s \S ] * ?$ / i) ;
64
+ var re = new RegExp ( / ^ . * ?b l a h . * ?$ / i) ;
68
65
69
66
expect ( rowSearcher . guessCondition ( filter ) ) . toEqual ( re ) ;
70
67
} ) ;
71
68
72
69
it ( 'should create a RegExp when term has a * in the middle' , function ( ) {
73
70
var filter = { term : 'bl*h' } ;
74
71
75
- var re = new RegExp ( / ^ b l [ \s \S ] * ?h $ / i) ;
72
+ var re = new RegExp ( / ^ b l . * ?h $ / i) ;
76
73
77
74
expect ( rowSearcher . guessCondition ( filter ) ) . toEqual ( re ) ;
78
75
} ) ;
@@ -82,8 +79,6 @@ describe('rowSearcher', function() {
82
79
83
80
expect ( rowSearcher . guessCondition ( filter ) ) . toEqual ( uiGridConstants . filter . CONTAINS , 'CONTAINS' ) ;
84
81
} ) ;
85
-
86
-
87
82
} ) ;
88
83
89
84
describe ( 'getTerm' , function ( ) {
0 commit comments