2019-07-25 01:24:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-04-16 12:02:12 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-16 14:09:01 -04:00
|
|
|
RSpec.describe 'IDE', :js do
|
2019-07-24 05:20:54 -04:00
|
|
|
describe 'sub-groups' do
|
2022-08-19 20:12:08 -04:00
|
|
|
let(:ide_iframe_selector) { '#ide iframe' }
|
2018-04-16 12:02:12 -04:00
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:group) { create(:group) }
|
|
|
|
let(:subgroup) { create(:group, parent: group) }
|
|
|
|
let(:subgroup_project) { create(:project, :repository, namespace: subgroup) }
|
|
|
|
|
|
|
|
before do
|
2022-08-19 20:12:08 -04:00
|
|
|
stub_feature_flags(vscode_web_ide: vscode_ff)
|
2018-07-11 10:36:08 -04:00
|
|
|
subgroup_project.add_maintainer(user)
|
2018-04-16 12:02:12 -04:00
|
|
|
sign_in(user)
|
|
|
|
|
|
|
|
visit project_path(subgroup_project)
|
|
|
|
|
|
|
|
click_link('Web IDE')
|
|
|
|
|
|
|
|
wait_for_requests
|
|
|
|
end
|
|
|
|
|
2022-08-19 20:12:08 -04:00
|
|
|
context 'with vscode feature flag on' do
|
|
|
|
let(:vscode_ff) { true }
|
|
|
|
|
|
|
|
it 'loads project in Web IDE' do
|
|
|
|
iframe = find(ide_iframe_selector)
|
|
|
|
|
|
|
|
page.within_frame(iframe) do
|
|
|
|
expect(page).to have_selector('.title', text: subgroup_project.name.upcase)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'with vscode feature flag off' do
|
|
|
|
let(:vscode_ff) { false }
|
|
|
|
|
|
|
|
it 'loads project in legacy Web IDE' do
|
|
|
|
expect(page).to have_selector('.context-header', text: subgroup_project.name)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'does not load new Web IDE' do
|
|
|
|
expect(page).not_to have_selector(ide_iframe_selector)
|
|
|
|
end
|
2018-04-16 12:02:12 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|