@@ -32,7 +32,7 @@ describe('ui-select tests', function() {
32
32
link : function ( scope , element , attrs , ctrl ) {
33
33
34
34
}
35
- }
35
+ } ;
36
36
37
37
} ) ;
38
38
@@ -111,8 +111,8 @@ describe('ui-select tests', function() {
111
111
if ( attrs . tagging !== undefined ) { attrsHtml += ' tagging="' + attrs . tagging + '"' ; }
112
112
if ( attrs . taggingTokens !== undefined ) { attrsHtml += ' tagging-tokens="' + attrs . taggingTokens + '"' ; }
113
113
if ( attrs . title !== undefined ) { attrsHtml += ' title="' + attrs . title + '"' ; }
114
- if ( attrs . appendToBody != undefined ) { attrsHtml += ' append-to-body="' + attrs . appendToBody + '"' ; }
115
- if ( attrs . allowClear != undefined ) { matchAttrsHtml += ' allow-clear="' + attrs . allowClear + '"' ; }
114
+ if ( attrs . appendToBody !== undefined ) { attrsHtml += ' append-to-body="' + attrs . appendToBody + '"' ; }
115
+ if ( attrs . allowClear !== undefined ) { matchAttrsHtml += ' allow-clear="' + attrs . allowClear + '"' ; }
116
116
}
117
117
118
118
return compileTemplate (
@@ -180,7 +180,7 @@ describe('ui-select tests', function() {
180
180
var $select = el . scope ( ) . $select ;
181
181
$select . open = true ;
182
182
scope . $digest ( ) ;
183
- } ;
183
+ }
184
184
185
185
function closeDropdown ( el ) {
186
186
var $select = el . scope ( ) . $select ;
@@ -986,7 +986,7 @@ describe('ui-select tests', function() {
986
986
scope . $digest ( ) ;
987
987
988
988
expect ( highlighted ) . toBe ( scope . people [ 5 ] ) ;
989
- } )
989
+ } ) ;
990
990
991
991
it ( 'should set $item & $model correctly when invoking callback on select and no single prop. binding' , function ( ) {
992
992
@@ -1223,7 +1223,7 @@ describe('ui-select tests', function() {
1223
1223
1224
1224
} ) ;
1225
1225
1226
- it ( 'should format view value correctly when using single property binding and refresh funcion ' , function ( ) {
1226
+ it ( 'should format view value correctly when using single property binding and refresh function ' , function ( ) {
1227
1227
1228
1228
var el = compileTemplate (
1229
1229
'<ui-select ng-model="selection.selected"> \
@@ -1241,19 +1241,19 @@ describe('ui-select tests', function() {
1241
1241
scope . fetchFromServer = function ( searching ) {
1242
1242
1243
1243
if ( searching == 's' )
1244
- return scope . people
1244
+ return scope . people ;
1245
1245
1246
1246
if ( searching == 'o' ) {
1247
1247
scope . people = [ ] ; //To simulate cases were previously selected item isnt in the list anymore
1248
1248
}
1249
1249
1250
1250
} ;
1251
1251
1252
- setSearchText ( el , 'r' )
1252
+ setSearchText ( el , 'r' ) ;
1253
1253
clickItem ( el , 'Samantha' ) ;
1254
1254
expect ( getMatchLabel ( el ) ) . toBe ( 'Samantha' ) ;
1255
1255
1256
- setSearchText ( el , 'o' )
1256
+ setSearchText ( el , 'o' ) ;
1257
1257
expect ( getMatchLabel ( el ) ) . toBe ( 'Samantha' ) ;
1258
1258
1259
1259
} ) ;
@@ -1428,7 +1428,7 @@ describe('ui-select tests', function() {
1428
1428
1429
1429
} ) ;
1430
1430
1431
- it ( 'should remove hightlighted match when pressing BACKSPACE key from search and decrease activeMatchIndex' , function ( ) {
1431
+ it ( 'should remove highlighted match when pressing BACKSPACE key from search and decrease activeMatchIndex' , function ( ) {
1432
1432
1433
1433
scope . selection . selectedMultiple = [ scope . people [ 4 ] , scope . people [ 5 ] , scope . people [ 6 ] ] ; //Wladimir, Samantha & Nicole
1434
1434
var el = createUiSelectMultiple ( ) ;
@@ -1444,7 +1444,7 @@ describe('ui-select tests', function() {
1444
1444
1445
1445
} ) ;
1446
1446
1447
- it ( 'should remove hightlighted match when pressing DELETE key from search and keep same activeMatchIndex' , function ( ) {
1447
+ it ( 'should remove highlighted match when pressing DELETE key from search and keep same activeMatchIndex' , function ( ) {
1448
1448
1449
1449
scope . selection . selectedMultiple = [ scope . people [ 4 ] , scope . people [ 5 ] , scope . people [ 6 ] ] ; //Wladimir, Samantha & Nicole
1450
1450
var el = createUiSelectMultiple ( ) ;
@@ -1479,13 +1479,13 @@ describe('ui-select tests', function() {
1479
1479
var searchInput = el . find ( '.ui-select-search' ) ;
1480
1480
1481
1481
expect ( isDropdownOpened ( el ) ) . toEqual ( false ) ;
1482
- triggerKeydown ( searchInput , Key . Left )
1483
- triggerKeydown ( searchInput , Key . Left )
1482
+ triggerKeydown ( searchInput , Key . Left ) ;
1483
+ triggerKeydown ( searchInput , Key . Left ) ;
1484
1484
expect ( isDropdownOpened ( el ) ) . toEqual ( false ) ;
1485
1485
expect ( el . scope ( ) . $selectMultiple . activeMatchIndex ) . toBe ( el . scope ( ) . $select . selected . length - 2 ) ;
1486
- triggerKeydown ( searchInput , Key . Left )
1487
- triggerKeydown ( searchInput , Key . Left )
1488
- triggerKeydown ( searchInput , Key . Left )
1486
+ triggerKeydown ( searchInput , Key . Left ) ;
1487
+ triggerKeydown ( searchInput , Key . Left ) ;
1488
+ triggerKeydown ( searchInput , Key . Left ) ;
1489
1489
expect ( el . scope ( ) . $selectMultiple . activeMatchIndex ) . toBe ( 0 ) ;
1490
1490
1491
1491
} ) ;
@@ -1496,9 +1496,9 @@ describe('ui-select tests', function() {
1496
1496
var el = createUiSelectMultiple ( ) ;
1497
1497
var searchInput = el . find ( '.ui-select-search' ) ;
1498
1498
1499
- el . scope ( ) . $selectMultiple . activeMatchIndex = 3
1500
- triggerKeydown ( searchInput , Key . Left )
1501
- triggerKeydown ( searchInput , Key . Left )
1499
+ el . scope ( ) . $selectMultiple . activeMatchIndex = 3 ;
1500
+ triggerKeydown ( searchInput , Key . Left ) ;
1501
+ triggerKeydown ( searchInput , Key . Left ) ;
1502
1502
expect ( el . scope ( ) . $selectMultiple . activeMatchIndex ) . toBe ( 1 ) ;
1503
1503
1504
1504
} ) ;
@@ -1509,9 +1509,9 @@ describe('ui-select tests', function() {
1509
1509
var el = createUiSelectMultiple ( ) ;
1510
1510
var searchInput = el . find ( '.ui-select-search' ) ;
1511
1511
1512
- el . scope ( ) . $selectMultiple . activeMatchIndex = 0
1513
- triggerKeydown ( searchInput , Key . Right )
1514
- triggerKeydown ( searchInput , Key . Right )
1512
+ el . scope ( ) . $selectMultiple . activeMatchIndex = 0 ;
1513
+ triggerKeydown ( searchInput , Key . Right ) ;
1514
+ triggerKeydown ( searchInput , Key . Right ) ;
1515
1515
expect ( el . scope ( ) . $selectMultiple . activeMatchIndex ) . toBe ( 2 ) ;
1516
1516
1517
1517
} ) ;
@@ -1523,7 +1523,7 @@ describe('ui-select tests', function() {
1523
1523
var searchInput = el . find ( '.ui-select-search' ) ;
1524
1524
1525
1525
expect ( isDropdownOpened ( el ) ) . toEqual ( false ) ;
1526
- triggerKeydown ( searchInput , Key . Down )
1526
+ triggerKeydown ( searchInput , Key . Down ) ;
1527
1527
expect ( isDropdownOpened ( el ) ) . toEqual ( true ) ;
1528
1528
1529
1529
} ) ;
@@ -1558,7 +1558,7 @@ describe('ui-select tests', function() {
1558
1558
var searchInput = el . find ( '.ui-select-search' ) ;
1559
1559
1560
1560
expect ( isDropdownOpened ( el ) ) . toEqual ( false ) ;
1561
- triggerKeydown ( searchInput , Key . Down )
1561
+ triggerKeydown ( searchInput , Key . Down ) ;
1562
1562
expect ( isDropdownOpened ( el ) ) . toEqual ( true ) ;
1563
1563
1564
1564
clickItem ( el , 'Wladimir' ) ;
@@ -1574,7 +1574,7 @@ describe('ui-select tests', function() {
1574
1574
var searchInput = el . find ( '.ui-select-search' ) ;
1575
1575
1576
1576
expect ( isDropdownOpened ( el ) ) . toEqual ( false ) ;
1577
- triggerKeydown ( searchInput , Key . Down )
1577
+ triggerKeydown ( searchInput , Key . Down ) ;
1578
1578
expect ( isDropdownOpened ( el ) ) . toEqual ( true ) ;
1579
1579
1580
1580
clickItem ( el , 'Wladimir' ) ;
@@ -1590,9 +1590,9 @@ describe('ui-select tests', function() {
1590
1590
var searchInput = el . find ( '.ui-select-search' ) ;
1591
1591
1592
1592
expect ( isDropdownOpened ( el ) ) . toEqual ( false ) ;
1593
- triggerKeydown ( searchInput , Key . Down )
1593
+ triggerKeydown ( searchInput , Key . Down ) ;
1594
1594
expect ( isDropdownOpened ( el ) ) . toEqual ( true ) ;
1595
- triggerKeydown ( searchInput , Key . Escape )
1595
+ triggerKeydown ( searchInput , Key . Escape ) ;
1596
1596
expect ( isDropdownOpened ( el ) ) . toEqual ( false ) ;
1597
1597
1598
1598
} ) ;
@@ -1603,8 +1603,8 @@ describe('ui-select tests', function() {
1603
1603
var el = createUiSelectMultiple ( ) ;
1604
1604
var searchInput = el . find ( '.ui-select-search' ) ;
1605
1605
1606
- triggerKeydown ( searchInput , Key . Down )
1607
- triggerKeydown ( searchInput , Key . Enter )
1606
+ triggerKeydown ( searchInput , Key . Down ) ;
1607
+ triggerKeydown ( searchInput , Key . Enter ) ;
1608
1608
expect ( scope . selection . selectedMultiple . length ) . toEqual ( 2 ) ;
1609
1609
1610
1610
} ) ;
@@ -1616,8 +1616,8 @@ describe('ui-select tests', function() {
1616
1616
spyOn ( jQuery . Event . prototype , 'preventDefault' ) ;
1617
1617
spyOn ( jQuery . Event . prototype , 'stopPropagation' ) ;
1618
1618
1619
- triggerKeydown ( searchInput , Key . Down )
1620
- triggerKeydown ( searchInput , Key . Enter )
1619
+ triggerKeydown ( searchInput , Key . Down ) ;
1620
+ triggerKeydown ( searchInput , Key . Enter ) ;
1621
1621
expect ( jQuery . Event . prototype . preventDefault ) . toHaveBeenCalled ( ) ;
1622
1622
expect ( jQuery . Event . prototype . stopPropagation ) . toHaveBeenCalled ( ) ;
1623
1623
@@ -1630,8 +1630,8 @@ describe('ui-select tests', function() {
1630
1630
spyOn ( jQuery . Event . prototype , 'preventDefault' ) ;
1631
1631
spyOn ( jQuery . Event . prototype , 'stopPropagation' ) ;
1632
1632
1633
- triggerKeydown ( searchInput , Key . Down )
1634
- triggerKeydown ( searchInput , Key . Escape )
1633
+ triggerKeydown ( searchInput , Key . Down ) ;
1634
+ triggerKeydown ( searchInput , Key . Escape ) ;
1635
1635
expect ( jQuery . Event . prototype . preventDefault ) . toHaveBeenCalled ( ) ;
1636
1636
expect ( jQuery . Event . prototype . stopPropagation ) . toHaveBeenCalled ( ) ;
1637
1637
@@ -1644,9 +1644,9 @@ describe('ui-select tests', function() {
1644
1644
1645
1645
triggerKeydown ( searchInput , Key . Down ) ; //Open dropdown
1646
1646
1647
- el . scope ( ) . $select . activeIndex = 0
1648
- triggerKeydown ( searchInput , Key . Down )
1649
- triggerKeydown ( searchInput , Key . Down )
1647
+ el . scope ( ) . $select . activeIndex = 0 ;
1648
+ triggerKeydown ( searchInput , Key . Down ) ;
1649
+ triggerKeydown ( searchInput , Key . Down ) ;
1650
1650
expect ( el . scope ( ) . $select . activeIndex ) . toBe ( 2 ) ;
1651
1651
1652
1652
} ) ;
@@ -1658,9 +1658,9 @@ describe('ui-select tests', function() {
1658
1658
1659
1659
triggerKeydown ( searchInput , Key . Down ) ; //Open dropdown
1660
1660
1661
- el . scope ( ) . $select . activeIndex = 5
1662
- triggerKeydown ( searchInput , Key . Up )
1663
- triggerKeydown ( searchInput , Key . Up )
1661
+ el . scope ( ) . $select . activeIndex = 5 ;
1662
+ triggerKeydown ( searchInput , Key . Up ) ;
1663
+ triggerKeydown ( searchInput , Key . Up ) ;
1664
1664
expect ( el . scope ( ) . $select . activeIndex ) . toBe ( 3 ) ;
1665
1665
1666
1666
} ) ;
@@ -1713,7 +1713,7 @@ describe('ui-select tests', function() {
1713
1713
1714
1714
} ) ;
1715
1715
1716
- it ( 'should format view value correctly when using single property binding and refresh funcion ' , function ( ) {
1716
+ it ( 'should format view value correctly when using single property binding and refresh function ' , function ( ) {
1717
1717
1718
1718
scope . selection . selectedMultiple = [ '[email protected] ' , '[email protected] ' ] ;
1719
1719
@@ -1733,21 +1733,21 @@ describe('ui-select tests', function() {
1733
1733
scope . fetchFromServer = function ( searching ) {
1734
1734
1735
1735
if ( searching == 'n' )
1736
- return scope . people
1736
+ return scope . people ;
1737
1737
1738
1738
if ( searching == 'o' ) {
1739
1739
scope . people = [ ] ; //To simulate cases were previously selected item isnt in the list anymore
1740
1740
}
1741
1741
1742
1742
} ;
1743
1743
1744
- setSearchText ( el , 'n' )
1744
+ setSearchText ( el , 'n' ) ;
1745
1745
clickItem ( el , 'Nicole' ) ;
1746
1746
1747
1747
expect ( el . find ( '.ui-select-match-item [uis-transclude-append]:not(.ng-hide)' ) . text ( ) )
1748
1748
1749
1749
1750
- setSearchText ( el , 'o' )
1750
+ setSearchText ( el , 'o' ) ;
1751
1751
1752
1752
expect ( el . find ( '.ui-select-match-item [uis-transclude-append]:not(.ng-hide)' ) . text ( ) )
1753
1753
@@ -1801,7 +1801,7 @@ describe('ui-select tests', function() {
1801
1801
scope . counter = 0 ;
1802
1802
scope . onlyOnce = function ( ) {
1803
1803
scope . counter ++ ;
1804
- }
1804
+ } ;
1805
1805
1806
1806
clickItem ( el , 'Nicole' ) ;
1807
1807
@@ -1970,7 +1970,7 @@ describe('ui-select tests', function() {
1970
1970
function checkElements ( els ) {
1971
1971
for ( var i = 0 ; i < els . length ; i ++ ) {
1972
1972
expect ( els [ i ] . attributes [ 'aria-label' ] ) . toBeTruthy ( ) ;
1973
- } ;
1973
+ }
1974
1974
}
1975
1975
}
1976
1976
} ) ;
0 commit comments