Merge pull request #8153 from opf/bim/fix-bcf-snapshot-column-second-try
Bim/fix bcf snapshot column second trypull/8167/head
commit
cd5013f923
@ -0,0 +1,37 @@ |
||||
require 'spec_helper' |
||||
|
||||
describe 'BCF snapshot column', type: :feature, js: true, with_mail: false do |
||||
let(:project) { FactoryBot.create(:project) } |
||||
let(:wp_table) { Pages::WorkPackagesTable.new(project) } |
||||
let(:permissions) { %i[add_work_packages view_work_packages view_linked_issues] } |
||||
let!(:work_package) { FactoryBot.create(:work_package, project: project) } |
||||
let!(:bcf_issue) { FactoryBot.create(:bcf_issue_with_viewpoint, work_package: work_package) } |
||||
let(:user) do |
||||
FactoryBot.create :user, |
||||
member_in_project: project, |
||||
member_with_permissions: permissions |
||||
end |
||||
let!(:query) do |
||||
query = FactoryBot.build(:query, user: user, project: project) |
||||
query.column_names = ['subject', 'bcf_thumbnail'] |
||||
query.filters.clear |
||||
query.show_hierarchies = false |
||||
|
||||
query.save! |
||||
query |
||||
end |
||||
|
||||
before do |
||||
login_as(user) |
||||
end |
||||
|
||||
it 'shows BCF snapshot column correctly (Regression)' do |
||||
wp_table.visit_query query |
||||
wp_table.expect_work_package_listed(work_package) |
||||
|
||||
page.within(".wp-row-#{work_package.id} td.bcfThumbnail") do |
||||
image_path = "/api/bcf/2.1/projects/#{project.identifier}/topics/#{bcf_issue.uuid}/viewpoints/#{bcf_issue.viewpoints.first.uuid}/snapshot" |
||||
expect(page).to have_selector("img[src=\"#{image_path}\"]") |
||||
end |
||||
end |
||||
end |
Loading…
Reference in new issue