From 10de10381565fc0f42c0975c9678769ec1637976 Mon Sep 17 00:00:00 2001 From: Becky Siegel Date: Tue, 18 Jul 2017 21:27:54 +0000 Subject: [PATCH] Revert "Update iron-input to 2.0" This reverts commit 37636a62564b09df8d8e4e48828b72afdf817bb0. Reason for revert: The googlesource.com environment is not ready for this yet. I didn't realize that we couldn't yet use the hybrid version of the elements in google3 yet. They exist in the polymer2 directory, but apparently that depends on using polymer2. This change will need to be reverted until iron-input v1 is updated to get the polymer2 "hybrid" version. Change-Id: Ibeeae2458337b0a225993e12b043b1e65c3c4c04 --- WORKSPACE | 4 +- lib/js/bower_archives.bzl | 48 ++++---- lib/js/bower_components.bzl | 12 +- .../gr-create-group-dialog.html | 5 +- .../gr-create-group-dialog.js | 2 +- .../gr-create-group-dialog_test.html | 15 ++- .../gr-create-project-dialog.html | 5 +- .../elements/admin/gr-project/gr-project.html | 11 +- .../change/gr-account-list/gr-account-list.js | 2 +- .../gr-account-list/gr-account-list_test.html | 77 ++++++------- .../gr-confirm-cherrypick-dialog.html | 8 +- .../gr-confirm-rebase-dialog.html | 8 +- .../change/gr-reply-dialog/gr-reply-dialog.js | 8 +- .../gr-reply-dialog/gr-reply-dialog_test.html | 90 +++++++-------- .../gr-search-bar/gr-search-bar_test.html | 76 +++++------- .../gr-diff-preferences.html | 41 +++---- .../gr-diff-preferences_test.html | 59 +++++----- .../gr-account-info/gr-account-info.html | 20 ++-- .../gr-account-info/gr-account-info_test.html | 29 +++-- .../gr-email-editor/gr-email-editor.html | 2 + .../gr-menu-editor/gr-menu-editor.html | 21 ++-- .../settings/gr-menu-editor/gr-menu-editor.js | 2 +- .../gr-menu-editor/gr-menu-editor_test.html | 47 ++++---- .../gr-registration-dialog.html | 14 +-- .../gr-settings-view/gr-settings-view.html | 38 +++--- .../gr-watched-projects-editor.html | 1 + .../gr-watched-projects-editor_test.html | 4 +- .../gr-autocomplete/gr-autocomplete.html | 30 +++-- .../shared/gr-autocomplete/gr-autocomplete.js | 3 +- .../gr-autocomplete/gr-autocomplete_test.html | 108 +++++++----------- .../gr-copy-clipboard/gr-copy-clipboard.html | 12 +- .../gr-editable-label/gr-editable-label.html | 9 +- .../gr-editable-label/gr-editable-label.js | 7 +- .../gr-editable-label_test.html | 70 +++++------- .../shared/gr-list-view/gr-list-view.html | 5 +- polygerrit-ui/app/polylint_test.sh | 2 +- polygerrit-ui/app/styles/gr-form-styles.html | 2 +- polygerrit-ui/app/styles/shared-styles.html | 1 - 38 files changed, 399 insertions(+), 499 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index d6f08f1b0c..41d5803520 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1062,8 +1062,8 @@ bower_archive( bower_archive( name = "iron-input", package = "polymerelements/iron-input", - sha1 = "42f233d8adf3883bcce2fa364c7785a5d2571db4", - version = "2.0.0", + sha1 = "9bc0c8e81de2527125383cbcf74dd9f27e7fa9ac", + version = "1.0.10", ) bower_archive( diff --git a/lib/js/bower_archives.bzl b/lib/js/bower_archives.bzl index 3819edff29..9b965219ac 100644 --- a/lib/js/bower_archives.bzl +++ b/lib/js/bower_archives.bzl @@ -25,8 +25,8 @@ def load_bower_archives(): bower_archive( name = "iron-a11y-announcer", package = "iron-a11y-announcer", - version = "2.0.0", - sha1 = "8a7cc8d63eab3c068e0f8fcf4bf129a85922edc6") + version = "1.0.5", + sha1 = "007902c041dd8863a1fe893f62450852f4d8c69b") bower_archive( name = "iron-a11y-keys-behavior", package = "iron-a11y-keys-behavior", @@ -35,38 +35,38 @@ def load_bower_archives(): bower_archive( name = "iron-behaviors", package = "iron-behaviors", - version = "1.0.18", - sha1 = "e231a1a02b090f5183db917639fdb96cdd0dca18") + version = "1.0.17", + sha1 = "47df7e1c2b97978dcafa13edb50fbdb702570acd") bower_archive( name = "iron-fit-behavior", package = "iron-fit-behavior", - version = "1.2.7", - sha1 = "01c485fbf898307029bbb72ac7e132db1570a842") + version = "1.2.6", + sha1 = "59daa8526aac59aa72b8edcbbd24d9eed555a0f5") bower_archive( name = "iron-flex-layout", package = "iron-flex-layout", - version = "1.3.7", - sha1 = "4d4cf3232cf750a17a7df0a37476117f831ac633") + version = "1.3.2", + sha1 = "b896041aad049a5e889a0165828d7b1262e32612") bower_archive( name = "iron-form-element-behavior", package = "iron-form-element-behavior", - version = "1.0.7", - sha1 = "7b5a79e02cc32f0918725dd26925d0df1e03ed12") + version = "1.0.6", + sha1 = "8d9e6530edc1b99bec1a5c34853911fba3701220") bower_archive( name = "iron-meta", package = "iron-meta", - version = "1.1.3", - sha1 = "f77eba3f6f6817f10bda33918bde8f963d450041") + version = "1.1.2", + sha1 = "dc22fe05e1cb5f94f30a7193d3433ca1808773b8") bower_archive( name = "iron-resizable-behavior", package = "iron-resizable-behavior", - version = "1.0.6", - sha1 = "719c2a8a1a784f8aefcdeef41fcc2e5a03518d9e") + version = "1.0.5", + sha1 = "2ebe983377dceb3794dd335131050656e23e2beb") bower_archive( name = "iron-validatable-behavior", package = "iron-validatable-behavior", - version = "1.1.2", - sha1 = "7111f34ff32e1510131dfbdb1eaa51bfa291e8be") + version = "1.1.1", + sha1 = "480423380be0536f948735d91bc472f6e7ced5b4") bower_archive( name = "lodash", package = "lodash", @@ -75,18 +75,18 @@ def load_bower_archives(): bower_archive( name = "mocha", package = "mocha", - version = "3.4.2", - sha1 = "dfa9fd7705c541e8df3bfa22ca83789920024258") + version = "3.2.0", + sha1 = "b77f23f7ad1f1363501bcae96f0f4f47745dad0f") bower_archive( name = "neon-animation", package = "neon-animation", - version = "1.2.5", - sha1 = "588d289f779d02b21ce5b676e257bbd6155649e8") + version = "1.2.4", + sha1 = "e8ccbb930c4b7ff470b1450baa901618888a7fd3") bower_archive( name = "sinon-chai", package = "sinon-chai", - version = "2.11.0", - sha1 = "3facb0ee3d4e06b8cd444c76e2fcb6d8b2ae3091") + version = "2.8.0", + sha1 = "0464b5d944fdf8116bb23e0b02ecfbac945b3517") bower_archive( name = "sinonjs", package = "sinonjs", @@ -100,8 +100,8 @@ def load_bower_archives(): bower_archive( name = "web-animations-js", package = "web-animations-js", - version = "2.2.5", - sha1 = "078116d92a15ec4def5ca2be2cd09b331efc1eb7") + version = "2.2.2", + sha1 = "6276a9f227da7d4ccaf77c202b50e174dd11a2c2") bower_archive( name = "webcomponentsjs", package = "webcomponentsjs", diff --git a/lib/js/bower_components.bzl b/lib/js/bower_components.bzl index 9c3c63bd9c..9c3763e06d 100644 --- a/lib/js/bower_components.bzl +++ b/lib/js/bower_components.bzl @@ -167,6 +167,12 @@ def define_bower_components(): license = "//lib:LICENSE-page.js", seed = True, ) + bower_component( + name = "polymer", + license = "//lib:LICENSE-polymer", + deps = [ ":webcomponentsjs" ], + seed = True, + ) bower_component( name = "polymer-resin", license = "//lib:LICENSE-polymer", @@ -176,12 +182,6 @@ def define_bower_components(): ], seed = True, ) - bower_component( - name = "polymer", - license = "//lib:LICENSE-polymer", - deps = [ ":webcomponentsjs" ], - seed = True, - ) bower_component( name = "promise-polyfill", license = "//lib:LICENSE-promise-polyfill", diff --git a/polygerrit-ui/app/elements/admin/gr-create-group-dialog/gr-create-group-dialog.html b/polygerrit-ui/app/elements/admin/gr-create-group-dialog/gr-create-group-dialog.html index 0456a2ef56..6612e38d97 100644 --- a/polygerrit-ui/app/elements/admin/gr-create-group-dialog/gr-create-group-dialog.html +++ b/polygerrit-ui/app/elements/admin/gr-create-group-dialog/gr-create-group-dialog.html @@ -38,11 +38,10 @@ limitations under the License.
Group name - - -
diff --git a/polygerrit-ui/app/elements/admin/gr-create-group-dialog/gr-create-group-dialog.js b/polygerrit-ui/app/elements/admin/gr-create-group-dialog/gr-create-group-dialog.js index 1e9994be78..51024d72ec 100644 --- a/polygerrit-ui/app/elements/admin/gr-create-group-dialog/gr-create-group-dialog.js +++ b/polygerrit-ui/app/elements/admin/gr-create-group-dialog/gr-create-group-dialog.js @@ -24,7 +24,7 @@ notify: true, value: false, }, - _name: String, + _name: Object, _groupCreated: { type: Boolean, value: false, diff --git a/polygerrit-ui/app/elements/admin/gr-create-group-dialog/gr-create-group-dialog_test.html b/polygerrit-ui/app/elements/admin/gr-create-group-dialog/gr-create-group-dialog_test.html index 0383946340..7766ea6816 100644 --- a/polygerrit-ui/app/elements/admin/gr-create-group-dialog/gr-create-group-dialog_test.html +++ b/polygerrit-ui/app/elements/admin/gr-create-group-dialog/gr-create-group-dialog_test.html @@ -50,14 +50,13 @@ limitations under the License. sandbox.restore(); }); - test('name is updated correctly', done => { - Polymer.Base.async(() => { - assert.isFalse(element.hasNewGroupName); - element.$.groupNameInput.bindValue = GROUP_NAME; - assert.isTrue(element.hasNewGroupName); - assert.deepEqual(element._name, GROUP_NAME); - done(); - }, 1); + test('name is updated correctly', () => { + assert.isFalse(element.hasNewGroupName); + + element.$.groupNameInput.bindValue = GROUP_NAME; + + assert.isTrue(element.hasNewGroupName); + assert.deepEqual(element._name, GROUP_NAME); }); test('test for redirecting to group on successful creation', done => { diff --git a/polygerrit-ui/app/elements/admin/gr-create-project-dialog/gr-create-project-dialog.html b/polygerrit-ui/app/elements/admin/gr-create-project-dialog/gr-create-project-dialog.html index 679d2b644a..19eadcef41 100644 --- a/polygerrit-ui/app/elements/admin/gr-create-project-dialog/gr-create-project-dialog.html +++ b/polygerrit-ui/app/elements/admin/gr-create-project-dialog/gr-create-project-dialog.html @@ -53,11 +53,10 @@ limitations under the License.
Project name - - -
Rights inherit from diff --git a/polygerrit-ui/app/elements/admin/gr-project/gr-project.html b/polygerrit-ui/app/elements/admin/gr-project/gr-project.html index 8ef970c62a..45f87c7dbb 100644 --- a/polygerrit-ui/app/elements/admin/gr-project/gr-project.html +++ b/polygerrit-ui/app/elements/admin/gr-project/gr-project.html @@ -170,13 +170,12 @@ limitations under the License.
Maximum Git object size limit - - - + bind-value="{{_projectConfig.max_object_size_limit.configured_value}}" + is="iron-input" + type="text" + disabled$="[[_readOnly]]">
diff --git a/polygerrit-ui/app/elements/change/gr-account-list/gr-account-list.js b/polygerrit-ui/app/elements/change/gr-account-list/gr-account-list.js index 63bb6f10e7..4e403e60be 100644 --- a/polygerrit-ui/app/elements/change/gr-account-list/gr-account-list.js +++ b/polygerrit-ui/app/elements/change/gr-account-list/gr-account-list.js @@ -194,7 +194,7 @@ }, _handleInputKeydown(e) { - const input = e.detail.input.inputElement; + const input = e.detail.input; if (input.selectionStart !== input.selectionEnd || input.selectionStart !== 0) { return; diff --git a/polygerrit-ui/app/elements/change/gr-account-list/gr-account-list_test.html b/polygerrit-ui/app/elements/change/gr-account-list/gr-account-list_test.html index 0aa1b71ca0..a3a3c6446e 100644 --- a/polygerrit-ui/app/elements/change/gr-account-list/gr-account-list_test.html +++ b/polygerrit-ui/app/elements/change/gr-account-list/gr-account-list_test.html @@ -329,51 +329,42 @@ limitations under the License. }); suite('keyboard interactions', () => { - test('backspace at text input start removes last account', done => { - Polymer.Base.async(() => { - const autocomplete = element.$.entry.$.input; - sandbox.stub(element.$.entry, '_getReviewerSuggestions'); - sandbox.stub(autocomplete, '_updateSuggestions'); - sandbox.stub(element, '_computeRemovable').returns(true); - // Next line is a workaround for Firefix not moving cursor - // on input field update - assert.equal(autocomplete.$.input.inputElement.selectionStart, 0); - autocomplete.text = 'test'; - MockInteractions.focus(autocomplete.$.input.inputElement); - flushAsynchronousOperations(); - assert.equal(element.accounts.length, 2); - MockInteractions.pressAndReleaseKeyOn( - autocomplete.$.input.inputElement, 8); // Backspace - assert.equal(element.accounts.length, 2); - autocomplete.text = ''; - MockInteractions.pressAndReleaseKeyOn( - autocomplete.$.input.inputElement, 8); // Backspace - assert.equal(element.accounts.length, 1); - done(); - }, 1); + test('backspace at text input start removes last account', () => { + const input = element.$.entry.$.input; + sandbox.stub(element.$.entry, '_getReviewerSuggestions'); + sandbox.stub(input, '_updateSuggestions'); + sandbox.stub(element, '_computeRemovable').returns(true); + // Next line is a workaround for Firefix not moving cursor + // on input field update + assert.equal(input.$.input.selectionStart, 0); + input.text = 'test'; + MockInteractions.focus(input.$.input); + flushAsynchronousOperations(); + assert.equal(element.accounts.length, 2); + MockInteractions.pressAndReleaseKeyOn(input.$.input, 8); // Backspace + assert.equal(element.accounts.length, 2); + input.text = ''; + MockInteractions.pressAndReleaseKeyOn(input.$.input, 8); // Backspace + assert.equal(element.accounts.length, 1); }); - test('arrow key navigation', done => { - Polymer.Base.async(() => { - const autocomplete = element.$.entry.$.input; - autocomplete.text = ''; - element.accounts = [makeAccount(), makeAccount()]; - MockInteractions.focus(autocomplete.$.input); - flushAsynchronousOperations(); - const chips = element.accountChips; - const chipsOneSpy = sandbox.spy(chips[1], 'focus'); - MockInteractions.pressAndReleaseKeyOn( - autocomplete.$.input.inputElement, 37); // Left - assert.isTrue(chipsOneSpy.called); - const chipsZeroSpy = sandbox.spy(chips[0], 'focus'); - MockInteractions.pressAndReleaseKeyOn(chips[1], 37); // Left - assert.isTrue(chipsZeroSpy.called); - MockInteractions.pressAndReleaseKeyOn(chips[0], 37); // Left - assert.isTrue(chipsZeroSpy.calledOnce); - MockInteractions.pressAndReleaseKeyOn(chips[0], 39); // Right - assert.isTrue(chipsOneSpy.calledTwice); - done(); - }, 1); + test('arrow key navigation', () => { + const input = element.$.entry.$.input; + input.text = ''; + element.accounts = [makeAccount(), makeAccount()]; + MockInteractions.focus(input.$.input); + flushAsynchronousOperations(); + const chips = element.accountChips; + const chipsOneSpy = sandbox.spy(chips[1], 'focus'); + MockInteractions.pressAndReleaseKeyOn(input.$.input, 37); // Left + assert.isTrue(chipsOneSpy.called); + const chipsZeroSpy = sandbox.spy(chips[0], 'focus'); + MockInteractions.pressAndReleaseKeyOn(chips[1], 37); // Left + assert.isTrue(chipsZeroSpy.called); + MockInteractions.pressAndReleaseKeyOn(chips[0], 37); // Left + assert.isTrue(chipsZeroSpy.calledOnce); + MockInteractions.pressAndReleaseKeyOn(chips[0], 39); // Right + assert.isTrue(chipsOneSpy.calledTwice); }); test('delete', done => { diff --git a/polygerrit-ui/app/elements/change/gr-confirm-cherrypick-dialog/gr-confirm-cherrypick-dialog.html b/polygerrit-ui/app/elements/change/gr-confirm-cherrypick-dialog/gr-confirm-cherrypick-dialog.html index 1f5b95bdda..ba8e1f1e4b 100644 --- a/polygerrit-ui/app/elements/change/gr-confirm-cherrypick-dialog/gr-confirm-cherrypick-dialog.html +++ b/polygerrit-ui/app/elements/change/gr-confirm-cherrypick-dialog/gr-confirm-cherrypick-dialog.html @@ -61,11 +61,11 @@ limitations under the License. - - - + bind-value="{{branch}}" + placeholder="Destination branch"> diff --git a/polygerrit-ui/app/elements/change/gr-confirm-rebase-dialog/gr-confirm-rebase-dialog.html b/polygerrit-ui/app/elements/change/gr-confirm-rebase-dialog/gr-confirm-rebase-dialog.html index 103eb55ba0..2772594b75 100644 --- a/polygerrit-ui/app/elements/change/gr-confirm-rebase-dialog/gr-confirm-rebase-dialog.html +++ b/polygerrit-ui/app/elements/change/gr-confirm-rebase-dialog/gr-confirm-rebase-dialog.html @@ -98,12 +98,12 @@ limitations under the License.
- - - + on-tap="_handleEnterChangeNumberTap" + placeholder="Change number">
diff --git a/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.js b/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.js index 0cfaacf78b..cfe7ad98a7 100644 --- a/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.js +++ b/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.js @@ -395,14 +395,10 @@ .focus.bind(textarea.getNativeTextarea())); } else if (section === FocusTarget.REVIEWERS) { const reviewerEntry = this.$.reviewers.focusStart; - Polymer.Base.async(() => { - reviewerEntry.inputElement.focus(); - }, 1); + reviewerEntry.async(reviewerEntry.focus); } else if (section === FocusTarget.CCS) { const ccEntry = this.$$('#ccs').focusStart; - Polymer.Base.async(() => { - ccEntry.inputElement.focus(); - }, 1); + ccEntry.async(ccEntry.focus); } }, diff --git a/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog_test.html b/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog_test.html index 5e9bd5e816..8bdf5b960f 100644 --- a/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog_test.html +++ b/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog_test.html @@ -267,14 +267,6 @@ limitations under the License. }); } - function testAsync(testFunc) { - return new Promise(resolve => { - Polymer.Base.async(() => { - resolve(testFunc()); - }, 1); - }); - } - function testConfirmationDialog(done, cc) { const yesButton = element.$$('.reviewerConfirmationButtons gr-button:first-child'); @@ -326,59 +318,55 @@ limitations under the License. MockInteractions.tap(noButton); // close the overlay return observer; }).then(() => { - return testAsync(() => { - assert.isFalse(isVisible(element.$.reviewerConfirmationOverlay)); + assert.isFalse(isVisible(element.$.reviewerConfirmationOverlay)); - // We should be focused on account entry input. - assert.equal(getActiveElement().tagName, 'INPUT'); + // We should be focused on account entry input. + assert.equal(getActiveElement().id, 'input'); - // No reviewer/CC should have been added. - assert.equal(element.$$('#ccs').additions().length, 0); - assert.equal(element.$.reviewers.additions().length, 0); + // No reviewer/CC should have been added. + assert.equal(element.$$('#ccs').additions().length, 0); + assert.equal(element.$.reviewers.additions().length, 0); - // Reopen confirmation dialog. - observer = overlayObserver('opened'); - if (cc) { - element._ccPendingConfirmation = { - group, - count: 10, - }; - } else { - element._reviewerPendingConfirmation = { - group, - count: 10, - }; - } - return observer; - }); - }).then(x => { + // Reopen confirmation dialog. + observer = overlayObserver('opened'); + if (cc) { + element._ccPendingConfirmation = { + group, + count: 10, + }; + } else { + element._reviewerPendingConfirmation = { + group, + count: 10, + }; + } + return observer; + }).then(() => { assert.isTrue(isVisible(element.$.reviewerConfirmationOverlay)); observer = overlayObserver('closed'); MockInteractions.tap(yesButton); // Confirm the group. return observer; }).then(() => { - return testAsync(() => { - assert.isFalse(isVisible(element.$.reviewerConfirmationOverlay)); - const additions = cc ? - element.$$('#ccs').additions() : - element.$.reviewers.additions(); - assert.deepEqual( - additions, - [ - { - group: { - id: 'id', - name: 'name', - confirmed: true, - _group: true, - _pendingAdd: true, - }, + assert.isFalse(isVisible(element.$.reviewerConfirmationOverlay)); + const additions = cc ? + element.$$('#ccs').additions() : + element.$.reviewers.additions(); + assert.deepEqual( + additions, + [ + { + group: { + id: 'id', + name: 'name', + confirmed: true, + _group: true, + _pendingAdd: true, }, - ]); + }, + ]); - // We should be focused on account entry input. - assert.equal(getActiveElement().tagName, 'INPUT'); - }); + // We should be focused on account entry input. + assert.equal(getActiveElement().id, 'input'); }).then(done); } diff --git a/polygerrit-ui/app/elements/core/gr-search-bar/gr-search-bar_test.html b/polygerrit-ui/app/elements/core/gr-search-bar/gr-search-bar_test.html index 4482279378..059ea7de35 100644 --- a/polygerrit-ui/app/elements/core/gr-search-bar/gr-search-bar_test.html +++ b/polygerrit-ui/app/elements/core/gr-search-bar/gr-search-bar_test.html @@ -65,47 +65,35 @@ limitations under the License. }); test('enter in search input triggers nav', done => { - Polymer.Base.async(() => { - sinon.stub(page, 'show', () => { - page.show.restore(); - assert.notEqual(getActiveElement(), element.$.searchInput); - assert.notEqual(getActiveElement(), element.$.searchButton); - done(); - }); - element.value = 'test'; - MockInteractions.pressAndReleaseKeyOn( - element.$.searchInput.$.input.inputElement, 13, - null, 'enter'); - }, 1); + sinon.stub(page, 'show', () => { + page.show.restore(); + assert.notEqual(getActiveElement(), element.$.searchInput); + assert.notEqual(getActiveElement(), element.$.searchButton); + done(); + }); + element.value = 'test'; + MockInteractions.pressAndReleaseKeyOn(element.$.searchInput.$.input, 13, + null, 'enter'); }); - test('search query should be double-escaped', done => { - Polymer.Base.async(() => { - const showStub = sinon.stub(page, 'show'); - element.$.searchInput.text = 'fate/stay'; - MockInteractions.pressAndReleaseKeyOn( - element.$.searchInput.$.input.inputElement, 13, - null, 'enter'); - assert.equal(showStub.lastCall.args[0], '/q/fate%252Fstay'); - showStub.restore(); - done(); - }, 1); + test('search query should be double-escaped', () => { + const showStub = sinon.stub(page, 'show'); + element.$.searchInput.text = 'fate/stay'; + MockInteractions.pressAndReleaseKeyOn(element.$.searchInput.$.input, 13, + null, 'enter'); + assert.equal(showStub.lastCall.args[0], '/q/fate%252Fstay'); + showStub.restore(); }); - test('input blurred after commit', done => { - Polymer.Base.async(() => { - const showStub = sinon.stub(page, 'show'); - const blurSpy = sinon.spy( - element.$.searchInput.$.input, 'blur'); - element.$.searchInput.text = 'fate/stay'; - MockInteractions.pressAndReleaseKeyOn( - element.$.searchInput.$.input.inputElement, 13, - null, 'enter'); - assert.isTrue(blurSpy.called); - showStub.restore(); - blurSpy.restore(); - done(); - }, 1); + test('input blurred after commit', () => { + const showStub = sinon.stub(page, 'show'); + const blurSpy = sinon.spy(element.$.searchInput.$.input, 'blur'); + element.$.searchInput.text = 'fate/stay'; + MockInteractions.pressAndReleaseKeyOn(element.$.searchInput.$.input, 13, + null, 'enter'); + assert.isTrue(blurSpy.called); + showStub.restore(); + blurSpy.restore(); }); test('empty search query does not trigger nav', () => { @@ -116,14 +104,12 @@ limitations under the License. assert.isFalse(showSpy.called); }); - test('keyboard shortcuts', done => { - Polymer.Base.async(() => { - const focusSpy = sinon.spy(element.$.searchInput, 'focus'); - const selectAllSpy = sinon.spy(element.$.searchInput, 'selectAll'); - MockInteractions.pressAndReleaseKeyOn(document.body, 191, null, '/'); - assert.isTrue(focusSpy.called); - assert.isTrue(selectAllSpy.called); done(); - }, 1); + test('keyboard shortcuts', () => { + const focusSpy = sinon.spy(element.$.searchInput, 'focus'); + const selectAllSpy = sinon.spy(element.$.searchInput, 'selectAll'); + MockInteractions.pressAndReleaseKeyOn(document.body, 191, null, '/'); + assert.isTrue(focusSpy.called); + assert.isTrue(selectAllSpy.called); }); suite('_getSearchSuggestions', () => { diff --git a/polygerrit-ui/app/elements/diff/gr-diff-preferences/gr-diff-preferences.html b/polygerrit-ui/app/elements/diff/gr-diff-preferences/gr-diff-preferences.html index 4f57b343d0..99a70544ae 100644 --- a/polygerrit-ui/app/elements/diff/gr-diff-preferences/gr-diff-preferences.html +++ b/polygerrit-ui/app/elements/diff/gr-diff-preferences/gr-diff-preferences.html @@ -93,58 +93,49 @@ limitations under the License.
-
- - - +
- - -
- - - +
-
-
-
diff --git a/polygerrit-ui/app/elements/diff/gr-diff-preferences/gr-diff-preferences_test.html b/polygerrit-ui/app/elements/diff/gr-diff-preferences/gr-diff-preferences_test.html index 09043fa0e1..f06cd3a12d 100644 --- a/polygerrit-ui/app/elements/diff/gr-diff-preferences/gr-diff-preferences_test.html +++ b/polygerrit-ui/app/elements/diff/gr-diff-preferences/gr-diff-preferences_test.html @@ -45,39 +45,36 @@ limitations under the License. sandbox.restore(); }); - test('model changes', done => { - Polymer.Base.async(() => { - element.prefs = { - context: 10, - font_size: 12, - line_length: 100, - show_tabs: true, - tab_size: 8, - show_whitespace_errors: true, - syntax_highlighting: true, - }; - assert.deepEqual(element.prefs, element._newPrefs); + test('model changes', () => { + element.prefs = { + context: 10, + font_size: 12, + line_length: 100, + show_tabs: true, + tab_size: 8, + show_whitespace_errors: true, + syntax_highlighting: true, + }; + assert.deepEqual(element.prefs, element._newPrefs); - element.$.contextSelect.value = '50'; - element.fire('change', {}, {node: element.$.contextSelect}); - element.$.columnsInput.bindValue = 80; - element.$.fontSizeInput.bindValue = 10; - element.$.tabSizeInput.bindValue = 4; - MockInteractions.tap(element.$.showTabsInput); - MockInteractions.tap(element.$.showTrailingWhitespaceInput); - MockInteractions.tap(element.$.syntaxHighlightInput); - MockInteractions.tap(element.$.lineWrappingInput); + element.$.contextSelect.value = '50'; + element.fire('change', {}, {node: element.$.contextSelect}); + element.$.columnsInput.bindValue = 80; + element.$.fontSizeInput.bindValue = 10; + element.$.tabSizeInput.bindValue = 4; + MockInteractions.tap(element.$.showTabsInput); + MockInteractions.tap(element.$.showTrailingWhitespaceInput); + MockInteractions.tap(element.$.syntaxHighlightInput); + MockInteractions.tap(element.$.lineWrappingInput); - assert.equal(element._newPrefs.context, 50); - assert.equal(element._newPrefs.font_size, 10); - assert.equal(element._newPrefs.line_length, 80); - assert.equal(element._newPrefs.tab_size, 4); - assert.isFalse(element._newPrefs.show_tabs); - assert.isFalse(element._newPrefs.show_whitespace_errors); - assert.isTrue(element._newPrefs.line_wrapping); - assert.isFalse(element._newPrefs.syntax_highlighting); - done(); - }, 1); + assert.equal(element._newPrefs.context, 50); + assert.equal(element._newPrefs.font_size, 10); + assert.equal(element._newPrefs.line_length, 80); + assert.equal(element._newPrefs.tab_size, 4); + assert.isFalse(element._newPrefs.show_tabs); + assert.isFalse(element._newPrefs.show_whitespace_errors); + assert.isTrue(element._newPrefs.line_wrapping); + assert.isFalse(element._newPrefs.syntax_highlighting); }); test('clicking fit to screen hides line length input', () => { diff --git a/polygerrit-ui/app/elements/settings/gr-account-info/gr-account-info.html b/polygerrit-ui/app/elements/settings/gr-account-info/gr-account-info.html index 81b007e20f..494b9e87d6 100644 --- a/polygerrit-ui/app/elements/settings/gr-account-info/gr-account-info.html +++ b/polygerrit-ui/app/elements/settings/gr-account-info/gr-account-info.html @@ -16,7 +16,6 @@ limitations under the License. - @@ -57,25 +56,24 @@ limitations under the License. - - -
Status - - - - +
diff --git a/polygerrit-ui/app/elements/settings/gr-account-info/gr-account-info_test.html b/polygerrit-ui/app/elements/settings/gr-account-info/gr-account-info_test.html index e6accff065..84fbc09f64 100644 --- a/polygerrit-ui/app/elements/settings/gr-account-info/gr-account-info_test.html +++ b/polygerrit-ui/app/elements/settings/gr-account-info/gr-account-info_test.html @@ -128,26 +128,23 @@ limitations under the License. }); test('name', done => { - Polymer.Base.async(() => { - assert.isTrue(element.mutable); - assert.isFalse(element.hasUnsavedChanges); + assert.isTrue(element.mutable); + assert.isFalse(element.hasUnsavedChanges); - element.set('_account.name', 'new name'); + element.set('_account.name', 'new name'); - assert.isTrue(nameChangedSpy.called); - assert.isFalse(statusChangedSpy.called); - assert.isTrue(element.hasUnsavedChanges); + assert.isTrue(nameChangedSpy.called); + assert.isFalse(statusChangedSpy.called); + assert.isTrue(element.hasUnsavedChanges); - MockInteractions.pressAndReleaseKeyOn( - element.$.nameInput.inputElement, 13); + MockInteractions.pressAndReleaseKeyOn(element.$.nameInput, 13); - assert.isTrue(nameStub.called); - assert.isFalse(statusStub.called); - nameStub.lastCall.returnValue.then(() => { - assert.equal(nameStub.lastCall.args[0], 'new name'); - done(); - }); - }, 1); + assert.isTrue(nameStub.called); + assert.isFalse(statusStub.called); + nameStub.lastCall.returnValue.then(() => { + assert.equal(nameStub.lastCall.args[0], 'new name'); + done(); + }); }); test('status', done => { diff --git a/polygerrit-ui/app/elements/settings/gr-email-editor/gr-email-editor.html b/polygerrit-ui/app/elements/settings/gr-email-editor/gr-email-editor.html index 41c3979937..99a039233a 100644 --- a/polygerrit-ui/app/elements/settings/gr-email-editor/gr-email-editor.html +++ b/polygerrit-ui/app/elements/settings/gr-email-editor/gr-email-editor.html @@ -15,6 +15,7 @@ limitations under the License. --> + @@ -62,6 +63,7 @@ limitations under the License. [[item.email]] - - - + - - - diff --git a/polygerrit-ui/app/elements/settings/gr-menu-editor/gr-menu-editor.js b/polygerrit-ui/app/elements/settings/gr-menu-editor/gr-menu-editor.js index 8ebdee9f32..543c86df6e 100644 --- a/polygerrit-ui/app/elements/settings/gr-menu-editor/gr-menu-editor.js +++ b/polygerrit-ui/app/elements/settings/gr-menu-editor/gr-menu-editor.js @@ -58,7 +58,7 @@ }, _computeAddDisabled(newName, newUrl) { - return !newName || !newUrl; + return !newName.length || !newUrl.length; }, _handleInputKeydown(e) { diff --git a/polygerrit-ui/app/elements/settings/gr-menu-editor/gr-menu-editor_test.html b/polygerrit-ui/app/elements/settings/gr-menu-editor/gr-menu-editor_test.html index f10e447e47..f16ba6c313 100644 --- a/polygerrit-ui/app/elements/settings/gr-menu-editor/gr-menu-editor_test.html +++ b/polygerrit-ui/app/elements/settings/gr-menu-editor/gr-menu-editor_test.html @@ -64,22 +64,19 @@ limitations under the License. Polymer.dom.flush(); }); - test('renders', done => { + test('renders', () => { const rows = element.$$('tbody').querySelectorAll('tr'); let tds; - Polymer.Base.async(() => { - assert.equal(rows.length, menu.length); - for (let i = 0; i < menu.length; i++) { - tds = rows[i].querySelectorAll('td'); - assert.equal(tds[0].textContent, menu[i].name); - assert.equal(tds[1].textContent, menu[i].url); - } + assert.equal(rows.length, menu.length); + for (let i = 0; i < menu.length; i++) { + tds = rows[i].querySelectorAll('td'); + assert.equal(tds[0].textContent, menu[i].name); + assert.equal(tds[1].textContent, menu[i].url); + } - assert.isTrue(element._computeAddDisabled(element._newName, - element._newUrl)); - done(); - }, 1); + assert.isTrue(element._computeAddDisabled(element._newName, + element._newUrl)); }); test('_computeAddDisabled', () => { @@ -89,27 +86,23 @@ limitations under the License. assert.isFalse(element._computeAddDisabled('name', 'url')); }); - test('add a new menu item', done => { + test('add a new menu item', () => { const newName = 'new name'; const newUrl = 'new url'; - Polymer.Base.async(() => { - element._newName = newName; - element._newUrl = newUrl; + element._newName = newName; + element._newUrl = newUrl; + assert.isFalse(element._computeAddDisabled(element._newName, + element._newUrl)); - assert.isFalse(element._computeAddDisabled(element._newName, - element._newUrl)); + const originalMenuLength = element.menuItems.length; - const originalMenuLength = element.menuItems.length; + element._handleAddButton(); - element._handleAddButton(); - - assert.equal(element.menuItems.length, originalMenuLength + 1); - assert.equal(element.menuItems[element.menuItems.length - 1].name, - newName); - assert.equal(element.menuItems[element.menuItems.length - 1].url, newUrl); - done(); - }, 1); + assert.equal(element.menuItems.length, originalMenuLength + 1); + assert.equal(element.menuItems[element.menuItems.length - 1].name, + newName); + assert.equal(element.menuItems[element.menuItems.length - 1].url, newUrl); }); test('move items down', () => { diff --git a/polygerrit-ui/app/elements/settings/gr-registration-dialog/gr-registration-dialog.html b/polygerrit-ui/app/elements/settings/gr-registration-dialog/gr-registration-dialog.html index c0a38a514a..34f0b162c6 100644 --- a/polygerrit-ui/app/elements/settings/gr-registration-dialog/gr-registration-dialog.html +++ b/polygerrit-ui/app/elements/settings/gr-registration-dialog/gr-registration-dialog.html @@ -15,11 +15,10 @@ limitations under the License. --> - - +