diff options
author | Phil Hughes <me@iamphill.com> | 2016-11-07 16:58:50 +0000 |
---|---|---|
committer | Jacob Schatz <jschatz1@gmail.com> | 2016-11-21 21:01:45 -0500 |
commit | e95d43dfc5303dcb9e86359049b5f798e8351431 (patch) | |
tree | 6b7e1b4038e2dda26e9779a89f06f38c73585551 | |
parent | 08dd831f02daeeefedf65302a9a9575733943357 (diff) | |
download | gitlab-ce-e95d43dfc5303dcb9e86359049b5f798e8351431.tar.gz |
Fixed up tests
-rw-r--r-- | app/assets/javascripts/protected_branches/protected_branch_dropdown.js.es6 | 2 | ||||
-rw-r--r-- | spec/features/projects/ref_switcher_spec.rb | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/app/assets/javascripts/protected_branches/protected_branch_dropdown.js.es6 b/app/assets/javascripts/protected_branches/protected_branch_dropdown.js.es6 index e3f226e9a2a..9b551a1ed8c 100644 --- a/app/assets/javascripts/protected_branches/protected_branch_dropdown.js.es6 +++ b/app/assets/javascripts/protected_branches/protected_branch_dropdown.js.es6 @@ -48,7 +48,7 @@ class ProtectedBranchDropdown { onClickCreateWildcard() { // Refresh the dropdown's data, which ends up calling `getProtectedBranches` this.$dropdown.data('glDropdown').remote.execute(); - this.$dropdown.data('glDropdown').selectRowAtIndex(0); + this.$dropdown.data('glDropdown').selectRowAtIndex(gon.open_branches.length); } getProtectedBranches(term, callback) { diff --git a/spec/features/projects/ref_switcher_spec.rb b/spec/features/projects/ref_switcher_spec.rb index 472491188c9..38fe2d92885 100644 --- a/spec/features/projects/ref_switcher_spec.rb +++ b/spec/features/projects/ref_switcher_spec.rb @@ -17,14 +17,15 @@ feature 'Ref switcher', feature: true, js: true do page.within '.project-refs-form' do input = find('input[type="search"]') - input.set 'expand' + input.set 'binary' + wait_for_ajax input.native.send_keys :down input.native.send_keys :down input.native.send_keys :enter end - expect(page).to have_title 'expand-collapse-files' + expect(page).to have_title 'binary-encoding' end it "user selects ref with special characters" do |