Commit 3d6ce084 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch '230331-fix-geo-form-breadcrumbs' into 'master'

Geo - Fix Node Form Breadcrumbs

Closes #230331

See merge request gitlab-org/gitlab!37366
parents bb1bd337 9399d9de
- add_to_breadcrumbs _('Geo Nodes'), admin_geo_nodes_path
- page_title @form_title - page_title @form_title
#js-geo-node-form{ data: { "selective-sync-types" => selective_sync_types_json, #js-geo-node-form{ data: { "selective-sync-types" => selective_sync_types_json,
......
---
title: Geo - Fix Node Form Breadcrumbs
merge_request: 37366
author:
type: fixed
...@@ -17,6 +17,14 @@ RSpec.describe 'admin Geo Nodes', :js, :geo do ...@@ -17,6 +17,14 @@ RSpec.describe 'admin Geo Nodes', :js, :geo do
end end
end end
def expect_breadcrumb(text)
breadcrumbs = page.all(:css, '.breadcrumbs-list>li')
expect(breadcrumbs.length).to eq(3)
expect(breadcrumbs[0].text).to eq('Admin Area')
expect(breadcrumbs[1].text).to eq('Geo Nodes')
expect(breadcrumbs[2].text).to eq(text)
end
before do before do
allow(Gitlab::Geo).to receive(:license_allows?).and_return(true) allow(Gitlab::Geo).to receive(:license_allows?).and_return(true)
sign_in(create(:admin)) sign_in(create(:admin))
...@@ -103,7 +111,7 @@ RSpec.describe 'admin Geo Nodes', :js, :geo do ...@@ -103,7 +111,7 @@ RSpec.describe 'admin Geo Nodes', :js, :geo do
end end
end end
describe 'create a new Geo Nodes' do describe 'create a new Geo Node' do
let(:new_ssh_key) { attributes_for(:key)[:key] } let(:new_ssh_key) { attributes_for(:key)[:key] }
before do before do
...@@ -122,14 +130,20 @@ RSpec.describe 'admin Geo Nodes', :js, :geo do ...@@ -122,14 +130,20 @@ RSpec.describe 'admin Geo Nodes', :js, :geo do
expect(page).to have_content(geo_node.url) expect(page).to have_content(geo_node.url)
end end
end end
it 'includes Geo Nodes in breadcrumbs' do
expect_breadcrumb('Add New Node')
end
end end
describe 'update an existing Geo Node' do describe 'update an existing Geo Node' do
it 'updates an existing Geo Node' do before do
geo_node.update(primary: true) geo_node.update(primary: true)
visit edit_admin_geo_node_path(geo_node) visit edit_admin_geo_node_path(geo_node)
end
it 'updates an existing Geo Node' do
fill_in 'node-url-field', with: 'http://newsite.com' fill_in 'node-url-field', with: 'http://newsite.com'
fill_in 'node-internal-url-field', with: 'http://internal-url.com' fill_in 'node-internal-url-field', with: 'http://internal-url.com'
click_button 'Save changes' click_button 'Save changes'
...@@ -148,6 +162,10 @@ RSpec.describe 'admin Geo Nodes', :js, :geo do ...@@ -148,6 +162,10 @@ RSpec.describe 'admin Geo Nodes', :js, :geo do
end end
end end
end end
it 'includes Geo Nodes in breadcrumbs' do
expect_breadcrumb('Edit Geo Node')
end
end end
describe 'remove an existing Geo Node' do describe 'remove an existing Geo Node' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment