mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Load DFC Permissions module in system spec
But we can't access the inside of the component yet.
This commit is contained in:
32
spec/system/admin/enterprises/dfc_permissions_spec.rb
Normal file
32
spec/system/admin/enterprises/dfc_permissions_spec.rb
Normal 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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user