Load DFC Permissions module in system spec

But we can't access the inside of the component yet.
This commit is contained in:
Maikel Linke
2025-07-03 16:32:07 +10:00
parent 9d284b7110
commit 2d3f18a71b
2 changed files with 39 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
# frozen_string_literal: true
require "system_helper"
RSpec.describe "DFC Permissions", feature: "cqcm-dev", vcr: true do
let(:enterprise) { create(:enterprise) }
before do
login_as enterprise.owner
end
it "is not visible when no platform is enabled" do
Flipper.disable("cqcm-dev")
visit edit_admin_enterprise_path(enterprise)
expect(page).not_to have_content "CONNECTED APPS"
end
it "can share data with another platform" do
visit edit_admin_enterprise_path(enterprise)
scroll_to :bottom
click_link "Connected apps"
# TODO: interact with shadow root of web component
#
# expect(page).to have_content "Proxy Dev Portal"
# expect(page).to have_selector "svg.unchecked" # permission not granted
# click_on "Agree and share"
# expect(page).to have_selector "svg.checked" # permission granted
end
end

View File

@@ -20,6 +20,12 @@ Capybara.register_driver(:cuprite_ofn) do |app|
url_whitelist: [
%r{^http://localhost}, %r{^http://0.0.0.0}, %r{http://127.0.0.1},
# Testing the DFC Permissions component by Startin'Blox:
%r{^https://cdn.jsdelivr.net/npm/@startinblox/},
%r{^https://cdn.startinblox.com/},
%r{^https://data-server.cqcm.startinblox.com/scopes$},
%r{^https://api.proxy-dev.cqcm.startinblox.com/profile$},
# Just for testing external connections: spec/system/billy_spec.rb
%r{^https?://deb.debian.org},
],
@@ -44,6 +50,7 @@ RSpec.configure do |config|
original_host = Rails.application.default_url_options[:host]
Rails.application.default_url_options[:host] =
"#{Capybara.current_session.server.host}:#{Capybara.current_session.server.port}"
DfcProvider::Engine.routes.default_url_options = Rails.application.default_url_options
example.run
Rails.application.default_url_options[:host] = original_host
remove_downloaded_files