This repository was archived by the owner on Oct 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Issue 994: Change guard against closing the Select when in a multisel… #995
Open
jmckinney88
wants to merge
4
commits into
angular-ui:master
Choose a base branch
from
jmckinney88:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
4b5b837
Issue 994: Change guard against closing the Select when in a multisel…
1426b2d
Issue 994: Removed unused arg, $event.
8d0a9fd
Issue 994: Added necessary flushes to spec to accommodate timeout cal…
f6be59c
Issue 994: Added pre-select de-duping to prevent duplicates from with…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1035,6 +1035,7 @@ describe('ui-select tests', function() { | |
|
||
clickItem(el, 'Samantha'); | ||
clickItem(el, 'Adrian'); | ||
$timeout.flush(); | ||
el.find('.ui-select-match-item').first().find('.ui-select-match-close').click(); | ||
$timeout.flush(); | ||
|
||
|
@@ -1065,6 +1066,7 @@ describe('ui-select tests', function() { | |
|
||
clickItem(el, 'Samantha'); | ||
clickItem(el, 'Adrian'); | ||
$timeout.flush(); | ||
el.find('.ui-select-match-item').first().find('.ui-select-match-close').click(); | ||
$timeout.flush(); | ||
|
||
|
@@ -1120,6 +1122,7 @@ describe('ui-select tests', function() { | |
setSearchText(el, 'idontexist'); | ||
|
||
triggerKeydown(searchInput, Key.Enter); | ||
$timeout.flush(); | ||
|
||
expect($(el).scope().$select.selected).toEqual(['idontexist']); | ||
}); | ||
|
@@ -1358,6 +1361,7 @@ describe('ui-select tests', function() { | |
var el = createUiSelectMultiple(); | ||
expect(scope.selection.selectedMultiple instanceof Array).toBe(false); | ||
clickItem(el, 'Samantha'); | ||
$timeout.flush(); | ||
expect(scope.selection.selectedMultiple instanceof Array).toBe(true); | ||
}); | ||
|
||
|
@@ -1547,6 +1551,7 @@ describe('ui-select tests', function() { | |
var searchInput = el.find('.ui-select-search'); | ||
|
||
clickItem(el, 'Wladimir'); | ||
$timeout.flush(); | ||
expect(scope.selection.selectedMultiple).toEqual([scope.people[5], scope.people[4]]); //Samantha & Wladimir | ||
|
||
}); | ||
|
@@ -1605,6 +1610,7 @@ describe('ui-select tests', function() { | |
|
||
triggerKeydown(searchInput, Key.Down) | ||
triggerKeydown(searchInput, Key.Enter) | ||
$timeout.flush(); | ||
expect(scope.selection.selectedMultiple.length).toEqual(2); | ||
|
||
}); | ||
|
@@ -1707,6 +1713,7 @@ describe('ui-select tests', function() { | |
var searchInput = el.find('.ui-select-search'); | ||
|
||
clickItem(el, 'Natasha'); | ||
$timeout.flush(); | ||
|
||
expect(el.scope().$select.selected).toEqual([scope.people[4], scope.people[5], scope.people[7]]); | ||
scope.selection.selectedMultiple = ['[email protected]', '[email protected]', '[email protected]']; | ||
|
@@ -1743,6 +1750,7 @@ describe('ui-select tests', function() { | |
|
||
setSearchText(el, 'n') | ||
clickItem(el, 'Nicole'); | ||
$timeout.flush(); | ||
|
||
expect(el.find('.ui-select-match-item [uis-transclude-append]:not(.ng-hide)').text()) | ||
.toBe("Wladimir <[email protected]>Samantha <[email protected]>Nicole <[email protected]>"); | ||
|
@@ -1775,6 +1783,7 @@ describe('ui-select tests', function() { | |
.toBe("Wladimir <[email protected]>Samantha <[email protected]>"); | ||
|
||
clickItem(el, 'Nicole'); | ||
$timeout.flush(); | ||
|
||
expect(el.find('.ui-select-match-item [uis-transclude-append]:not(.ng-hide)').text()) | ||
.toBe("Wladimir <[email protected]>Samantha <[email protected]>Nicole <[email protected]>"); | ||
|
@@ -1804,6 +1813,7 @@ describe('ui-select tests', function() { | |
} | ||
|
||
clickItem(el, 'Nicole'); | ||
$timeout.flush(); | ||
|
||
expect(scope.counter).toBe(1); | ||
|
||
|
@@ -1866,6 +1876,7 @@ describe('ui-select tests', function() { | |
var el = createUiSelectMultiple({tagging: 'taggingFunc', taggingTokens: ",|ENTER"}); | ||
clickMatch(el); | ||
triggerPaste(el.find('input'), 'tag1'); | ||
$timeout.flush(); | ||
|
||
expect($(el).scope().$select.selected.length).toBe(1); | ||
}); | ||
|
@@ -1883,6 +1894,7 @@ describe('ui-select tests', function() { | |
var el = createUiSelectMultiple({tagging: 'taggingFunc', taggingTokens: ",|ENTER"}); | ||
clickMatch(el); | ||
triggerPaste(el.find('input'), ',tag1,tag2,tag3,,tag5,'); | ||
$timeout.flush(); | ||
|
||
expect($(el).scope().$select.selected.length).toBe(5); | ||
}); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems fragile - why is this necessary?