Commit ea05fcef authored by Simon Knox's avatar Simon Knox

Merge branch 'fix-epic-swimlanes-list-reposition' into 'master'

Fix epic swimlanes list repositioning not working

See merge request gitlab-org/gitlab!68908
parents 5930522c 2dd83ce4
......@@ -11,7 +11,7 @@ import { s__, n__, __ } from '~/locale';
import defaultSortableConfig from '~/sortable/sortable_config';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { calculateSwimlanesBufferSize } from '../boards_util';
import { DRAGGABLE_TAG, EPIC_LANE_BASE_HEIGHT } from '../constants';
import { DRAGGABLE_TAG, EPIC_LANE_BASE_HEIGHT, DraggableItemTypes } from '../constants';
import EpicLane from './epic_lane.vue';
import IssuesLaneList from './issues_lane_list.vue';
import SwimlanesLoadingSkeleton from './swimlanes_loading_skeleton.vue';
......@@ -19,6 +19,7 @@ import SwimlanesLoadingSkeleton from './swimlanes_loading_skeleton.vue';
export default {
EpicLane,
epicLaneBaseHeight: EPIC_LANE_BASE_HEIGHT,
draggableItemTypes: DraggableItemTypes,
components: {
BoardAddNewColumn,
BoardListHeader,
......@@ -215,6 +216,7 @@ export default {
class="board gl-display-inline-block gl-px-3 gl-vertical-align-top gl-white-space-normal"
:data-list-id="list.id"
data-testid="board-header-container"
:data-draggable-item-type="$options.draggableItemTypes.list"
>
<board-list-header
:can-admin-list="canAdminList"
......
......@@ -33,7 +33,7 @@ RSpec.describe 'epics swimlanes', :js do
stub_licensed_features(epics: true, swimlanes: true)
sign_in(user)
visit_board_page
load_board project_boards_path(project)
load_epic_swimlanes
load_unassigned_issues
end
......@@ -117,9 +117,24 @@ RSpec.describe 'epics swimlanes', :js do
end
end
def visit_board_page
visit project_boards_path(project)
wait_for_requests
context 'drag and drop list' do
let_it_be(:label2) { create(:label, project: project, name: 'Label 2') }
let_it_be(:list2) { create(:list, board: board, label: label2, position: 1) }
it 're-orders lists' do
drag(list_from_index: 1, list_to_index: 2, selector: '.board-header')
wait_for_requests
expect(find_board_list_header(2)).to have_content(label2.title)
expect(find_board_list_header(3)).to have_content(label.title)
expect(list.reload.position).to eq(1)
expect(list2.reload.position).to eq(0)
end
end
def find_board_list_header(list_idx)
find(".board:nth-child(#{list_idx}) [data-testid=\"board-list-header\"]")
end
def select_epics
......
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