2019-10-12 21:52:04 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-05-09 12:01:36 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
RSpec.describe 'IDE', :js do
|
2019-10-12 21:52:04 +05:30
|
|
|
describe 'sub-groups' do
|
2022-10-11 01:57:18 +05:30
|
|
|
let(:ide_iframe_selector) { '#ide iframe' }
|
2018-05-09 12:01:36 +05:30
|
|
|
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-10-11 01:57:18 +05:30
|
|
|
stub_feature_flags(vscode_web_ide: vscode_ff)
|
2018-11-18 11:00:15 +05:30
|
|
|
subgroup_project.add_maintainer(user)
|
2018-05-09 12:01:36 +05:30
|
|
|
sign_in(user)
|
|
|
|
|
|
|
|
visit project_path(subgroup_project)
|
|
|
|
|
|
|
|
click_link('Web IDE')
|
|
|
|
|
|
|
|
wait_for_requests
|
|
|
|
end
|
|
|
|
|
2022-10-11 01:57:18 +05:30
|
|
|
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-05-09 12:01:36 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|