@@ -412,21 +412,21 @@ describe('ui-select tests', function() {
412
412
expect ( getMatchLabel ( el ) ) . toEqual ( 'Samantha' ) ;
413
413
} ) ;
414
414
415
- it ( 'should correctly render initial state with track by $index' , function ( ) {
416
-
417
- var el = compileTemplate (
418
- '<ui-select ng-model="selection.selected"> \
419
- <ui-select-match placeholder="Pick one...">{{$select.selected.name}}</ui-select-match> \
420
- <ui-select-choices repeat="person in people track by $index"> \
421
- {{person.email}} \
422
- </ui-select-choices> \
423
- </ui-select>'
424
- ) ;
425
-
426
- openDropdown ( el ) ;
427
-
428
- var generatedId = el . scope ( ) . $select . generatedId ;
429
- expect ( $ ( el ) . find ( '[id="ui-select-choices-row-' + generatedId + '-0"]' ) . length ) . toEqual ( 1 ) ;
415
+ it ( 'should correctly render initial state with track by $index' , function ( ) {
416
+
417
+ var el = compileTemplate (
418
+ '<ui-select ng-model="selection.selected"> \
419
+ <ui-select-match placeholder="Pick one...">{{$select.selected.name}}</ui-select-match> \
420
+ <ui-select-choices repeat="person in people track by $index"> \
421
+ {{person.email}} \
422
+ </ui-select-choices> \
423
+ </ui-select>'
424
+ ) ;
425
+
426
+ openDropdown ( el ) ;
427
+
428
+ var generatedId = el . scope ( ) . $select . generatedId ;
429
+ expect ( $ ( el ) . find ( '[id="ui-select-choices-row-' + generatedId + '-0"]' ) . length ) . toEqual ( 1 ) ;
430
430
} ) ;
431
431
432
432
it ( 'should utilize wrapper directive ng-model' , function ( ) {
@@ -1530,12 +1530,12 @@ describe('ui-select tests', function() {
1530
1530
1531
1531
it ( 'should show search input when true' , function ( ) {
1532
1532
setupSelectComponent ( true , 'selectize' ) ;
1533
- expect ( $ ( el ) . find ( '.ui-select-search' ) ) . not . toHaveClass ( 'ng-hide ' ) ;
1533
+ expect ( $ ( el ) . find ( '.ui-select-search' ) ) . not . toHaveClass ( 'ui-select-search-hidden ' ) ;
1534
1534
} ) ;
1535
1535
1536
1536
it ( 'should hide search input when false' , function ( ) {
1537
1537
setupSelectComponent ( false , 'selectize' ) ;
1538
- expect ( $ ( el ) . find ( '.ui-select-search' ) ) . toHaveClass ( 'ng-hide ' ) ;
1538
+ expect ( $ ( el ) . find ( '.ui-select-search' ) ) . toHaveClass ( 'ui-select-search-hidden ' ) ;
1539
1539
} ) ;
1540
1540
1541
1541
} ) ;
@@ -1544,12 +1544,12 @@ describe('ui-select tests', function() {
1544
1544
1545
1545
it ( 'should show search input when true' , function ( ) {
1546
1546
setupSelectComponent ( 'true' , 'select2' ) ;
1547
- expect ( $ ( el ) . find ( '.select2-search' ) ) . not . toHaveClass ( 'ng-hide ' ) ;
1547
+ expect ( $ ( el ) . find ( '.select2-search' ) ) . not . toHaveClass ( 'ui-select-offscreen ' ) ;
1548
1548
} ) ;
1549
1549
1550
1550
it ( 'should hide search input when false' , function ( ) {
1551
1551
setupSelectComponent ( 'false' , 'select2' ) ;
1552
- expect ( $ ( el ) . find ( '.select2-search' ) ) . toHaveClass ( 'ng-hide ' ) ;
1552
+ expect ( $ ( el ) . find ( '.select2-search' ) ) . toHaveClass ( 'ui-select-offscreen ' ) ;
1553
1553
} ) ;
1554
1554
1555
1555
} ) ;
@@ -1559,13 +1559,25 @@ describe('ui-select tests', function() {
1559
1559
it ( 'should show search input when true' , function ( ) {
1560
1560
setupSelectComponent ( 'true' , 'bootstrap' ) ;
1561
1561
clickMatch ( el ) ;
1562
- expect ( $ ( el ) . find ( '.ui-select-search' ) ) . not . toHaveClass ( 'ng-hide' ) ;
1562
+ expect ( $ ( el ) . find ( '.ui-select-search' ) ) . not . toHaveClass ( 'ui-select-offscreen' ) ;
1563
+ } ) ;
1564
+
1565
+ it ( 'should hide match template when is true' , function ( ) {
1566
+ setupSelectComponent ( 'true' , 'bootstrap' ) ;
1567
+ clickMatch ( el ) ;
1568
+ expect ( $ ( el ) . find ( '.ui-select-match' ) ) . toHaveClass ( 'ng-hide' ) ;
1563
1569
} ) ;
1564
1570
1565
1571
it ( 'should hide search input when false' , function ( ) {
1566
1572
setupSelectComponent ( 'false' , 'bootstrap' ) ;
1567
1573
clickMatch ( el ) ;
1568
- expect ( $ ( el ) . find ( '.ui-select-search' ) ) . toHaveClass ( 'ng-hide' ) ;
1574
+ expect ( $ ( el ) . find ( '.ui-select-search' ) ) . toHaveClass ( 'ui-select-offscreen' ) ;
1575
+ } ) ;
1576
+
1577
+ it ( 'should show match template when is false' , function ( ) {
1578
+ setupSelectComponent ( 'false' , 'bootstrap' ) ;
1579
+ clickMatch ( el ) ;
1580
+ expect ( $ ( el ) . find ( '.ui-select-match' ) ) . not . toHaveClass ( 'ng-hide' ) ;
1569
1581
} ) ;
1570
1582
1571
1583
} ) ;
@@ -1607,42 +1619,42 @@ describe('ui-select tests', function() {
1607
1619
expect ( el . find ( '.ui-select-match-item' ) . length ) . toBe ( 0 ) ;
1608
1620
} ) ;
1609
1621
1610
- it ( 'should render intial state with data-multiple attribute' , function ( ) {
1611
- // ensure match template has been loaded by having more than one selection
1612
- scope . selection . selectedMultiple = [ scope . people [ 0 ] , scope . people [ 1 ] ] ;
1613
-
1622
+ it ( 'should render intial state with data-multiple attribute' , function ( ) {
1623
+ // ensure match template has been loaded by having more than one selection
1624
+ scope . selection . selectedMultiple = [ scope . people [ 0 ] , scope . people [ 1 ] ] ;
1625
+
1614
1626
var el = compileTemplate (
1615
1627
'<ui-select data-multiple ng-model="selection.selectedMultiple" theme="bootstrap" style="width: 800px;"> \
1616
1628
<ui-select-match placeholder="Pick one...">{{$item.name}} <{{$item.email}}></ui-select-match> \
1617
1629
<ui-select-choices repeat="person in people | filter: $select.search"> \
1618
1630
<div ng-bind-html="person.name | highlight: $select.search"></div> \
1619
1631
<div ng-bind-html="person.email | highlight: $select.search"></div> \
1620
1632
</ui-select-choices> \
1621
- </ui-select>'
1622
- ) ;
1623
-
1633
+ </ui-select>'
1634
+ ) ;
1635
+
1624
1636
expect ( el ) . toHaveClass ( 'ui-select-multiple' ) ;
1625
1637
expect ( el . scope ( ) . $select . selected . length ) . toBe ( 2 ) ;
1626
- expect ( el . find ( '.ui-select-match-item' ) . length ) . toBe ( 2 ) ;
1638
+ expect ( el . find ( '.ui-select-match-item' ) . length ) . toBe ( 2 ) ;
1627
1639
} ) ;
1628
1640
1629
- it ( 'should render intial state with x-multiple attribute' , function ( ) {
1630
- // ensure match template has been loaded by having more than one selection
1631
- scope . selection . selectedMultiple = [ scope . people [ 0 ] , scope . people [ 1 ] ] ;
1632
-
1641
+ it ( 'should render intial state with x-multiple attribute' , function ( ) {
1642
+ // ensure match template has been loaded by having more than one selection
1643
+ scope . selection . selectedMultiple = [ scope . people [ 0 ] , scope . people [ 1 ] ] ;
1644
+
1633
1645
var el = compileTemplate (
1634
1646
'<ui-select x-multiple ng-model="selection.selectedMultiple" theme="bootstrap" style="width: 800px;"> \
1635
1647
<ui-select-match placeholder="Pick one...">{{$item.name}} <{{$item.email}}></ui-select-match> \
1636
1648
<ui-select-choices repeat="person in people | filter: $select.search"> \
1637
1649
<div ng-bind-html="person.name | highlight: $select.search"></div> \
1638
1650
<div ng-bind-html="person.email | highlight: $select.search"></div> \
1639
1651
</ui-select-choices> \
1640
- </ui-select>'
1641
- ) ;
1642
-
1652
+ </ui-select>'
1653
+ ) ;
1654
+
1643
1655
expect ( el ) . toHaveClass ( 'ui-select-multiple' ) ;
1644
1656
expect ( el . scope ( ) . $select . selected . length ) . toBe ( 2 ) ;
1645
- expect ( el . find ( '.ui-select-match-item' ) . length ) . toBe ( 2 ) ;
1657
+ expect ( el . find ( '.ui-select-match-item' ) . length ) . toBe ( 2 ) ;
1646
1658
} ) ;
1647
1659
1648
1660
it ( 'should set model as an empty array if ngModel isnt defined after an item is selected' , function ( ) {
0 commit comments