Skip to content

Commit 2646f39

Browse files
author
Rick Yang
committed
Fix auto test error since we load data after activated
[why] We do not load data if user has not open dropdown yet. [how] For these failed test, call activate() before operations.
1 parent 7737de9 commit 2646f39

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

test/select.spec.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,11 @@ describe('ui-select tests', function() {
16231623
scope.fetchFromServer = function(){};
16241624

16251625
spyOn(scope, 'fetchFromServer');
1626-
1626+
1627+
el.scope().$select.activate();
1628+
scope.$digest();
1629+
$timeout.flush();
1630+
16271631
el.scope().$select.search = 'r';
16281632
scope.$digest();
16291633
$timeout.flush();
@@ -1651,7 +1655,11 @@ describe('ui-select tests', function() {
16511655
scope.fetchFromServer = function(){};
16521656

16531657
spyOn(scope, 'fetchFromServer');
1654-
1658+
1659+
el.scope().$select.activate();
1660+
scope.$digest();
1661+
$timeout.flush();
1662+
16551663
el.scope().$select.search = 'r';
16561664
scope.$digest();
16571665
$timeout.flush();
@@ -3106,6 +3114,7 @@ describe('ui-select tests', function() {
31063114
spyOn(scope, 'fetchFromServer');
31073115
expect(el.scope().$select.open).toEqual(false);
31083116
el.scope().$select.activate();
3117+
scope.$digest();
31093118
$timeout.flush();
31103119
expect(el.scope().$select.open).toEqual(true);
31113120
expect(scope.fetchFromServer.calls.any()).toEqual(true);

0 commit comments

Comments
 (0)