summaryrefslogtreecommitdiff
path: root/spec/features/projects/blobs
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-05-16 09:08:02 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-05-16 09:08:02 +0000
commit613868af23d7c0e09210857518895edd6678f5e9 (patch)
tree90b5ba583bbec4cb2a1eef3b34b2df1bb13de50f /spec/features/projects/blobs
parentb78b8c1103e1e9542891a1c333c8abcd4d7e10ab (diff)
downloadgitlab-ce-613868af23d7c0e09210857518895edd6678f5e9.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/projects/blobs')
-rw-r--r--spec/features/projects/blobs/edit_spec.rb47
1 files changed, 24 insertions, 23 deletions
diff --git a/spec/features/projects/blobs/edit_spec.rb b/spec/features/projects/blobs/edit_spec.rb
index 6e335871ed1..7474f416146 100644
--- a/spec/features/projects/blobs/edit_spec.rb
+++ b/spec/features/projects/blobs/edit_spec.rb
@@ -83,29 +83,20 @@ RSpec.describe 'Editing file blob', :js, feature_category: :projects do
end
context 'blob edit toolbar' do
- toolbar_buttons = [
- "Add bold text",
- "Add italic text",
- "Add strikethrough text",
- "Insert a quote",
- "Insert code",
- "Add a link",
- "Add a bullet list",
- "Add a numbered list",
- "Add a checklist",
- "Add a collapsible section",
- "Add a table"
- ]
-
- it "does not have any buttons" do
- stub_feature_flags(source_editor_toolbar: true)
- visit project_edit_blob_path(project, tree_join(branch, readme_file_path))
- buttons = page.all('.file-buttons .md-header-toolbar button[type="button"]')
- expect(buttons.length).to eq(0)
- end
-
- it "has defined set of toolbar buttons when the flag is off" do
- stub_feature_flags(source_editor_toolbar: false)
+ def has_toolbar_buttons
+ toolbar_buttons = [
+ "Add bold text",
+ "Add italic text",
+ "Add strikethrough text",
+ "Insert a quote",
+ "Insert code",
+ "Add a link",
+ "Add a bullet list",
+ "Add a numbered list",
+ "Add a checklist",
+ "Add a collapsible section",
+ "Add a table"
+ ]
visit project_edit_blob_path(project, tree_join(branch, readme_file_path))
buttons = page.all('.file-buttons .md-header-toolbar button[type="button"]')
expect(buttons.length).to eq(toolbar_buttons.length)
@@ -113,6 +104,16 @@ RSpec.describe 'Editing file blob', :js, feature_category: :projects do
expect(buttons[i]['title']).to include(button_title)
end
end
+
+ it "has defined set of toolbar buttons when the flag is on" do
+ stub_feature_flags(source_editor_toolbar: true)
+ has_toolbar_buttons
+ end
+
+ it "has defined set of toolbar buttons when the flag is off" do
+ stub_feature_flags(source_editor_toolbar: false)
+ has_toolbar_buttons
+ end
end
context 'from blob file path' do