Commit f551724d authored by Eulyeon Ko's avatar Eulyeon Ko Committed by Eulyeon Ko

Unstub graphql_board_lists FF from sidebar specs

Project issue boards are now powered by graphql.

A subset of sidebar specs needed some updating due to
differences in css selectors and elements used (ex. using
button over link text).

Certain functionalites are missing from graphql-based boards
code and their specs have been skipped.
parent aa9e31b0
...@@ -69,6 +69,7 @@ export default { ...@@ -69,6 +69,7 @@ export default {
<board-editable-item <board-editable-item
ref="sidebarItem" ref="sidebarItem"
class="board-sidebar-due-date" class="board-sidebar-due-date"
data-testid="sidebar-due-date"
:title="$options.i18n.dueDate" :title="$options.i18n.dueDate"
:loading="loading" :loading="loading"
@open="openDatePicker" @open="openDatePicker"
......
...@@ -113,6 +113,7 @@ export default { ...@@ -113,6 +113,7 @@ export default {
ref="sidebarItem" ref="sidebarItem"
:title="$options.i18n.milestone" :title="$options.i18n.milestone"
:loading="loading" :loading="loading"
data-testid="sidebar-milestones"
@open="handleOpen()" @open="handleOpen()"
@close="handleClose" @close="handleClose"
> >
......
...@@ -17,8 +17,6 @@ RSpec.describe 'Project issue boards sidebar due date', :js do ...@@ -17,8 +17,6 @@ RSpec.describe 'Project issue boards sidebar due date', :js do
end end
before do before do
stub_feature_flags(graphql_board_lists: false)
project.add_maintainer(user) project.add_maintainer(user)
sign_in(user) sign_in(user)
...@@ -31,10 +29,10 @@ RSpec.describe 'Project issue boards sidebar due date', :js do ...@@ -31,10 +29,10 @@ RSpec.describe 'Project issue boards sidebar due date', :js do
it 'updates due date' do it 'updates due date' do
click_card(card) click_card(card)
page.within('.due_date') do page.within('[data-testid="sidebar-due-date"]') do
today = Date.today.day today = Date.today.day
click_link 'Edit' click_button 'Edit'
click_button today.to_s click_button today.to_s
......
...@@ -18,8 +18,6 @@ RSpec.describe 'Project issue boards sidebar labels', :js do ...@@ -18,8 +18,6 @@ RSpec.describe 'Project issue boards sidebar labels', :js do
let(:card) { find('.board:nth-child(2)').first('.board-card') } let(:card) { find('.board:nth-child(2)').first('.board-card') }
before do before do
stub_feature_flags(graphql_board_lists: false)
project.add_maintainer(user) project.add_maintainer(user)
sign_in(user) sign_in(user)
...@@ -29,7 +27,8 @@ RSpec.describe 'Project issue boards sidebar labels', :js do ...@@ -29,7 +27,8 @@ RSpec.describe 'Project issue boards sidebar labels', :js do
end end
context 'labels' do context 'labels' do
it 'shows current labels when editing' do # https://gitlab.com/gitlab-org/gitlab/-/issues/322725
xit 'shows current labels when editing' do
click_card(card) click_card(card)
page.within('.labels') do page.within('.labels') do
...@@ -49,15 +48,15 @@ RSpec.describe 'Project issue boards sidebar labels', :js do ...@@ -49,15 +48,15 @@ RSpec.describe 'Project issue boards sidebar labels', :js do
click_card(card) click_card(card)
page.within('.labels') do page.within('.labels') do
click_link 'Edit' click_button 'Edit'
wait_for_requests wait_for_requests
click_link bug.title click_link bug.title
wait_for_requests find('[data-testid="close-icon"]').click
find('.dropdown-menu-close-icon').click wait_for_requests
page.within('.value') do page.within('.value') do
expect(page).to have_selector('.gl-label-text', count: 3) expect(page).to have_selector('.gl-label-text', count: 3)
...@@ -74,19 +73,17 @@ RSpec.describe 'Project issue boards sidebar labels', :js do ...@@ -74,19 +73,17 @@ RSpec.describe 'Project issue boards sidebar labels', :js do
click_card(card) click_card(card)
page.within('.labels') do page.within('.labels') do
click_link 'Edit' click_button 'Edit'
wait_for_requests wait_for_requests
click_link bug.title click_link bug.title
wait_for_requests
click_link regression.title click_link regression.title
wait_for_requests find('[data-testid="close-icon"]').click
find('.dropdown-menu-close-icon').click wait_for_requests
page.within('.value') do page.within('.value') do
expect(page).to have_selector('.gl-label-text', count: 4) expect(page).to have_selector('.gl-label-text', count: 4)
...@@ -105,17 +102,15 @@ RSpec.describe 'Project issue boards sidebar labels', :js do ...@@ -105,17 +102,15 @@ RSpec.describe 'Project issue boards sidebar labels', :js do
click_card(card) click_card(card)
page.within('.labels') do page.within('.labels') do
click_link 'Edit' click_button 'Edit'
wait_for_requests wait_for_requests
within('.dropdown-menu-labels') do click_link stretch.title
click_link stretch.title
end
wait_for_requests find('[data-testid="close-icon"]').click
find('.dropdown-menu-close-icon').click wait_for_requests
page.within('.value') do page.within('.value') do
expect(page).to have_selector('.gl-label-text', count: 1) expect(page).to have_selector('.gl-label-text', count: 1)
...@@ -128,7 +123,8 @@ RSpec.describe 'Project issue boards sidebar labels', :js do ...@@ -128,7 +123,8 @@ RSpec.describe 'Project issue boards sidebar labels', :js do
expect(card).not_to have_content(stretch.title) expect(card).not_to have_content(stretch.title)
end end
it 'creates project label' do # https://gitlab.com/gitlab-org/gitlab/-/issues/324290
xit 'creates project label' do
click_card(card) click_card(card)
page.within('.labels') do page.within('.labels') do
...@@ -146,7 +142,8 @@ RSpec.describe 'Project issue boards sidebar labels', :js do ...@@ -146,7 +142,8 @@ RSpec.describe 'Project issue boards sidebar labels', :js do
expect(page).to have_selector('.board', count: 3) expect(page).to have_selector('.board', count: 3)
end end
it 'creates project label and list' do # https://gitlab.com/gitlab-org/gitlab/-/issues/324290
xit 'creates project label and list' do
click_card(card) click_card(card)
page.within('.labels') do page.within('.labels') do
......
...@@ -16,8 +16,6 @@ RSpec.describe 'Project issue boards sidebar milestones', :js do ...@@ -16,8 +16,6 @@ RSpec.describe 'Project issue boards sidebar milestones', :js do
let(:card2) { find('.board:nth-child(1) .board-card:nth-of-type(2)') } let(:card2) { find('.board:nth-child(1) .board-card:nth-of-type(2)') }
before do before do
stub_feature_flags(graphql_board_lists: false)
project.add_maintainer(user) project.add_maintainer(user)
sign_in(user) sign_in(user)
...@@ -30,12 +28,12 @@ RSpec.describe 'Project issue boards sidebar milestones', :js do ...@@ -30,12 +28,12 @@ RSpec.describe 'Project issue boards sidebar milestones', :js do
it 'adds a milestone' do it 'adds a milestone' do
click_card(card1) click_card(card1)
page.within('.milestone') do page.within('[data-testid="sidebar-milestones"]') do
click_link 'Edit' click_button 'Edit'
wait_for_requests wait_for_requests
click_link milestone.title click_button milestone.title
wait_for_requests wait_for_requests
...@@ -48,12 +46,12 @@ RSpec.describe 'Project issue boards sidebar milestones', :js do ...@@ -48,12 +46,12 @@ RSpec.describe 'Project issue boards sidebar milestones', :js do
it 'removes a milestone' do it 'removes a milestone' do
click_card(card2) click_card(card2)
page.within('.milestone') do page.within('[data-testid="sidebar-milestones"]') do
click_link 'Edit' click_button 'Edit'
wait_for_requests wait_for_requests
click_link "No milestone" click_button "No milestone"
wait_for_requests wait_for_requests
......
...@@ -13,8 +13,6 @@ RSpec.describe 'Project issue boards sidebar', :js do ...@@ -13,8 +13,6 @@ RSpec.describe 'Project issue boards sidebar', :js do
let(:card) { find('.board:nth-child(1)').first('.board-card') } let(:card) { find('.board:nth-child(1)').first('.board-card') }
before do before do
stub_feature_flags(graphql_board_lists: false)
project.add_maintainer(user) project.add_maintainer(user)
sign_in(user) sign_in(user)
...@@ -44,7 +42,7 @@ RSpec.describe 'Project issue boards sidebar', :js do ...@@ -44,7 +42,7 @@ RSpec.describe 'Project issue boards sidebar', :js do
expect(page).to have_selector('.issue-boards-sidebar') expect(page).to have_selector('.issue-boards-sidebar')
find('.gutter-toggle').click find("[data-testid='sidebar-drawer'] .gl-drawer-close-button").click
expect(page).not_to have_selector('.issue-boards-sidebar') expect(page).not_to have_selector('.issue-boards-sidebar')
end 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