Commit 9606309f authored by Dan Davison's avatar Dan Davison

Merge branch 'test-read-only-board-configuration' into 'master'

Add test for user that has read-only access to boards configuration

See merge request gitlab-org/gitlab!18209
parents 86f22223 f827f58a
......@@ -194,6 +194,7 @@ export default {
ref="name"
v-model="board.name"
class="form-control"
data-qa-selector="board_name_field"
type="text"
:placeholder="__('Enter board name')"
@keyup.enter="submit"
......
......@@ -98,7 +98,7 @@ export default {
</script>
<template>
<div>
<div data-qa-selector="board_scope_modal">
<div v-if="canAdminBoard" class="media append-bottom-10">
<label class="form-section-title label-bold media-body">{{ __('Board scope') }}</label>
<button v-if="collapseScope" type="button" class="btn" @click="expanded = !expanded">
......
......@@ -37,6 +37,7 @@ export default boardsStore => {
class="btn btn-inverted"
:class="{ 'dot-highlight': hasScope }"
type="button"
data-qa-selector="boards_config_button"
@click.prevent="showPage('edit')"
>
{{ buttonText }}
......
......@@ -11,6 +11,10 @@ module QA
element :board_card
end
view 'app/assets/javascripts/boards/components/board_form.vue' do
element :board_name_field
end
view 'app/assets/javascripts/boards/components/board_list.vue' do
element :board_list_cards_area
end
......@@ -28,6 +32,14 @@ module QA
element :board_list_header
end
view 'ee/app/assets/javascripts/boards/components/board_scope.vue' do
element :board_scope_modal
end
view 'ee/app/assets/javascripts/boards/config_toggle.js' do
element :boards_config_button
end
view 'ee/app/assets/javascripts/boards/toggle_focus.js' do
element :focus_mode_button
end
......@@ -39,6 +51,10 @@ module QA
find('.issue-boards-content.js-focus-mode-board.is-focused')
end
def board_scope_modal
find_element(:board_scope_modal)
end
def boards_dropdown
find_element(:boards_dropdown)
end
......@@ -67,10 +83,18 @@ module QA
end
end
def click_boards_config_button
click_element(:boards_config_button)
end
def click_focus_mode_button
click_element(:focus_mode_button)
end
def has_modal_board_name_field?
has_element?(:board_name_field, wait: 1)
end
private
def wait_boards_list_finish_loading
......
# frozen_string_literal: true
module QA
context 'Plan' do
describe 'Read-only board configuration' do
let(:qa_user) do
Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1)
end
let(:label_board_list) do
EE::Resource::Board::BoardList::Project::LabelBoardList.fabricate_via_api!
end
before do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
Page::Main::Login.perform(&:sign_in_using_credentials)
label_board_list.project.add_member(qa_user, Resource::Members::AccessLevel::GUEST)
Page::Main::Login.perform do |login|
login.sign_out_and_sign_in_as user: qa_user
end
label_board_list.project.visit!
Page::Project::Menu.perform(&:go_to_boards)
end
it 'shows board configuration to user without edit permission' do
EE::Page::Project::Issue::Board::Show.perform do |show|
show.click_boards_config_button
expect(show.board_scope_modal).to be_visible
expect(show).not_to have_modal_board_name_field
end
end
end
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