Commit 465f95a8 authored by Filipa Lacerda's avatar Filipa Lacerda

Fix broken rspec tests

parent 873d60d5
......@@ -2,7 +2,8 @@ import Api from './api';
import { normalizeCRLFHeaders } from './lib/utils/common_utils';
export default function groupsSelect() {
const PER_PAGE = 20;
// Needs to be accessible in rspec
window.GROUP_SELECT_PER_PAGE = 20;
$('.ajax-groups-select').each(function setAjaxGroupsSelect2() {
const $select = $(this);
const allAvailable = $select.data('all-available');
......@@ -16,8 +17,7 @@ export default function groupsSelect() {
dataType: 'json',
quietMillis: 250,
transport(params) {
// eslint-disable-next-line promise/catch-or-return
$.ajax(params)
return $.ajax(params)
.then((data, status, xhr) => {
const results = data || [];
......@@ -40,7 +40,7 @@ export default function groupsSelect() {
return {
search,
page,
per_page: PER_PAGE,
per_page: window.GROUP_SELECT_PER_PAGE,
all_available: allAvailable,
};
},
......
......@@ -149,7 +149,7 @@ feature 'Project > Members > Share with Group', :js do
create(:group).add_owner(master)
visit project_settings_members_path(project)
execute_script 'GroupsSelect.PER_PAGE = 1;'
execute_script 'GROUP_SELECT_PER_PAGE = 1;'
open_select2 '#link_group_id'
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment