diff options
Diffstat (limited to 'spec/features/projects/blobs/edit_spec.rb')
-rw-r--r-- | spec/features/projects/blobs/edit_spec.rb | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/spec/features/projects/blobs/edit_spec.rb b/spec/features/projects/blobs/edit_spec.rb index a369bacc4dd..5aca994f53e 100644 --- a/spec/features/projects/blobs/edit_spec.rb +++ b/spec/features/projects/blobs/edit_spec.rb @@ -11,10 +11,6 @@ RSpec.describe 'Editing file blob', :js do let(:file_path) { project.repository.ls_files(project.repository.root_ref)[1] } let(:readme_file_path) { 'README.md' } - before do - stub_feature_flags(web_ide_default: false) - end - context 'as a developer' do let(:user) { create(:user) } let(:role) { :developer } @@ -36,8 +32,7 @@ RSpec.describe 'Editing file blob', :js do def fill_editor(content: 'class NextFeature\\nend\\n') wait_for_requests - find('#editor') - execute_script("ace.edit('editor').setValue('#{content}')") + execute_script("monaco.editor.getModels()[0].setValue('#{content}')") end context 'from MR diff' do @@ -67,6 +62,15 @@ RSpec.describe 'Editing file blob', :js do expect(find_by_id('file_path').value).to eq('ci/.gitlab-ci.yml') end + it 'updating file path updates syntax highlighting' do + visit project_edit_blob_path(project, tree_join(branch, readme_file_path)) + expect(find('#editor')['data-mode-id']).to eq('markdown') + + find('#file_path').send_keys('foo.txt') do + expect(find('#editor')['data-mode-id']).to eq('plaintext') + end + end + context 'from blob file path' do before do visit project_blob_path(project, tree_join(branch, file_path)) |