2020-03-13 15:44:24 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
RSpec.describe 'Issues > User sees live update', :js do
|
2020-03-13 15:44:24 +05:30
|
|
|
let_it_be(:project) { create(:project, :public) }
|
|
|
|
let_it_be(:user) { project.creator }
|
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in(user)
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'title issue#show' do
|
|
|
|
it 'updates the title' do
|
|
|
|
issue = create(:issue, author: user, assignees: [user], project: project, title: 'new title')
|
|
|
|
|
|
|
|
visit project_issue_path(project, issue)
|
|
|
|
|
|
|
|
expect(page).to have_text("new title")
|
|
|
|
|
2021-04-29 21:17:54 +05:30
|
|
|
issue.update!(title: "updated title")
|
2020-03-13 15:44:24 +05:30
|
|
|
|
|
|
|
wait_for_requests
|
|
|
|
expect(page).to have_text("updated title")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'confidential issue#show' do
|
2021-01-29 00:20:46 +05:30
|
|
|
it 'shows confidential sibebar information as confidential and can be turned off', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/254644' do
|
2020-03-13 15:44:24 +05:30
|
|
|
issue = create(:issue, :confidential, project: project)
|
|
|
|
|
|
|
|
visit project_issue_path(project, issue)
|
|
|
|
|
|
|
|
expect(page).to have_css('.issuable-note-warning')
|
|
|
|
expect(find('.issuable-sidebar-item.confidentiality')).to have_css('.is-active')
|
|
|
|
expect(find('.issuable-sidebar-item.confidentiality')).not_to have_css('.not-active')
|
|
|
|
|
|
|
|
find('.confidential-edit').click
|
|
|
|
expect(page).to have_css('.sidebar-item-warning-message')
|
|
|
|
|
|
|
|
within('.sidebar-item-warning-message') do
|
2021-01-03 14:25:43 +05:30
|
|
|
find('[data-testid="confidential-toggle"]').click
|
2020-03-13 15:44:24 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
wait_for_requests
|
|
|
|
|
|
|
|
visit project_issue_path(project, issue)
|
|
|
|
|
|
|
|
expect(page).not_to have_css('.is-active')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|