OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/modules/bim/spec/features/bcf/bcf_snapshot_column_spec.rb

37 lines
1.3 KiB

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/myproject_no_1/topics/#{bcf_issue.uuid}/viewpoints/#{bcf_issue.viewpoints.first.uuid}/snapshot"
expect(page).to have_selector("img[src=\"#{image_path}\"]")
end
end
end