Fix some tests for Polymer 2

admin/gr-create-group-dialog/gr-create-group-dialog_test.html
admin/gr-create-pointer-dialog/gr-create-pointer-dialog_test.html
admin/gr-create-repo-dialog/gr-create-repo-dialog_test.html

Extract a common test function for looking up the correct input element
for iron-inputs in both Polymer 1 and 2.

Change-Id: Iae5ec08ca714d5c6825eb7900f64262b71f2b69e
This commit is contained in:
Ben Rohlfs
2019-06-18 15:56:33 +02:00
parent 3604e820a9
commit 5917ed7512
6 changed files with 52 additions and 40 deletions

View File

@@ -15,4 +15,12 @@
* limitations under the License.
*/
// Intentionally blank - will contain shared Polymer 2 test setup code.
/**
* Helps looking up the proper iron-input element during the Polymer 2
* transition. Polymer 2 uses the <iron-input> element, while Polymer 1 uses
* the nested <input is="iron-input"> element.
*/
window.ironInput = function(element) {
return Polymer.dom(element).querySelector(
Polymer.Element ? 'iron-input' : 'input[is=iron-input]');
};