Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat #985 MultiAutoComplete: public methods for highlighting
Close #985.
- Loading branch information
Showing
7 changed files
with
224 additions
and
36 deletions.
There are no files selected for viewing
This file contains 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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 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 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 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
61 changes: 61 additions & 0 deletions
61
...idgets/form/autocomplete/multiautocomplete/testHighlightMethods/MultiAutoHighlightTest.js
This file contains 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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Copyright 2013 Amadeus s.a.s. | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
Aria.classDefinition({ | ||
$classpath : "test.aria.widgets.form.autocomplete.multiautocomplete.testHighlightMethods.MultiAutoHighlightTest", | ||
$extends : "test.aria.widgets.form.autocomplete.multiautocomplete.BaseMultiAutoCompleteTestCase", | ||
$constructor : function () { | ||
|
||
this.data = { | ||
ac_airline_values : ["India", "Singapore", "America", "France"], | ||
freeText : true | ||
}; | ||
|
||
this.$BaseMultiAutoCompleteTestCase.constructor.call(this); | ||
|
||
}, | ||
$prototype : { | ||
/** | ||
* This method is always the first entry point to a template test Start the test by focusing the first field | ||
*/ | ||
runTemplateTest : function () { | ||
var widgetInstance = this.getWidgetInstance("MultiAutoId"); | ||
this.checkSelectedItems(4); | ||
|
||
widgetInstance.addHighlight([1, 3, 4]); | ||
this.checkHighlightedElementsIndices([1, 3, 4]); | ||
// remove highlight with index | ||
widgetInstance.removeHighlight(3); | ||
|
||
// nothing should happen here | ||
widgetInstance.removeHighlight(0); | ||
this.checkHighlightedElementsIndices([1, 4]); | ||
// add highlight with index | ||
widgetInstance.addHighlight(2); | ||
this.checkHighlightedElementsIndices([1, 2, 4]); | ||
|
||
// remove highlight with array of indices | ||
widgetInstance.removeHighlight([2, 4]); | ||
this.checkHighlightedElementsIndices([1]); | ||
|
||
// add highlight with array of indices | ||
widgetInstance.addHighlight([2, 3, 4]); | ||
// remove highlight with no argument | ||
widgetInstance.removeHighlight(); | ||
this.checkHighlightedElementsIndices([]); | ||
this.end(); | ||
} | ||
} | ||
}); |