summaryrefslogtreecommitdiff
path: root/spec/features/ide
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-11-19 08:27:35 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-11-19 08:27:35 +0000
commit7e9c479f7de77702622631cff2628a9c8dcbc627 (patch)
treec8f718a08e110ad7e1894510980d2155a6549197 /spec/features/ide
parente852b0ae16db4052c1c567d9efa4facc81146e88 (diff)
downloadgitlab-ce-7e9c479f7de77702622631cff2628a9c8dcbc627.tar.gz
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'spec/features/ide')
-rw-r--r--spec/features/ide/user_sees_editor_info_spec.rb93
1 files changed, 93 insertions, 0 deletions
diff --git a/spec/features/ide/user_sees_editor_info_spec.rb b/spec/features/ide/user_sees_editor_info_spec.rb
new file mode 100644
index 00000000000..3760d6bd435
--- /dev/null
+++ b/spec/features/ide/user_sees_editor_info_spec.rb
@@ -0,0 +1,93 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe 'IDE user sees editor info', :js do
+ include WebIdeSpecHelpers
+
+ let_it_be(:project) { create(:project, :public, :repository) }
+ let_it_be(:user) { project.owner }
+
+ before do
+ sign_in(user)
+
+ ide_visit(project)
+ end
+
+ it 'shows line position' do
+ ide_open_file('README.md')
+
+ within find('.ide-status-bar') do
+ expect(page).to have_content('1:1')
+ end
+
+ ide_set_editor_position(4, 10)
+
+ within find('.ide-status-bar') do
+ expect(page).not_to have_content('1:1')
+ expect(page).to have_content('4:10')
+ end
+ end
+
+ it 'updates after rename' do
+ ide_open_file('README.md')
+ ide_set_editor_position(4, 10)
+
+ within find('.ide-status-bar') do
+ expect(page).to have_content('markdown')
+ expect(page).to have_content('4:10')
+ end
+
+ ide_rename_file('README.md', 'READMEZ.txt')
+
+ within find('.ide-status-bar') do
+ expect(page).to have_content('plaintext')
+ expect(page).to have_content('1:1')
+ end
+ end
+
+ it 'persists position after rename' do
+ ide_open_file('README.md')
+ ide_set_editor_position(4, 10)
+
+ ide_open_file('files/js/application.js')
+ ide_rename_file('README.md', 'READING_RAINBOW.md')
+
+ ide_open_file('READING_RAINBOW.md')
+
+ within find('.ide-status-bar') do
+ expect(page).to have_content('4:10')
+ end
+ end
+
+ it 'persists position' do
+ ide_open_file('README.md')
+ ide_set_editor_position(4, 10)
+
+ ide_close_file('README.md')
+ ide_open_file('README.md')
+
+ within find('.ide-status-bar') do
+ expect(page).to have_content('markdown')
+ expect(page).to have_content('4:10')
+ end
+ end
+
+ it 'persists viewer' do
+ ide_open_file('README.md')
+ click_link('Preview Markdown')
+
+ within find('.md-previewer') do
+ expect(page).to have_content('testme')
+ end
+
+ # Switch away from and back to the file
+ ide_open_file('.gitignore')
+ ide_open_file('README.md')
+
+ # Preview is still enabled
+ within find('.md-previewer') do
+ expect(page).to have_content('testme')
+ end
+ end
+end