Commit 9399d9de authored by Zack Cuddy's avatar Zack Cuddy Committed by Jose Ivan Vargas

Geo - Fix Node Form Breadcrumbs

This change adds the proper middle layer to the
breadcrumbs for the Geo Node Form.
parent 5cea2b4c
- add_to_breadcrumbs _('Geo Nodes'), admin_geo_nodes_path
- page_title @form_title
#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
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
allow(Gitlab::Geo).to receive(:license_allows?).and_return(true)
sign_in(create(:admin))
......@@ -103,7 +111,7 @@ RSpec.describe 'admin Geo Nodes', :js, :geo do
end
end
describe 'create a new Geo Nodes' do
describe 'create a new Geo Node' do
let(:new_ssh_key) { attributes_for(:key)[:key] }
before do
......@@ -122,14 +130,20 @@ RSpec.describe 'admin Geo Nodes', :js, :geo do
expect(page).to have_content(geo_node.url)
end
end
it 'includes Geo Nodes in breadcrumbs' do
expect_breadcrumb('Add New Node')
end
end
describe 'update an existing Geo Node' do
it 'updates an existing Geo Node' do
before do
geo_node.update(primary: true)
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-internal-url-field', with: 'http://internal-url.com'
click_button 'Save changes'
......@@ -148,6 +162,10 @@ RSpec.describe 'admin Geo Nodes', :js, :geo do
end
end
end
it 'includes Geo Nodes in breadcrumbs' do
expect_breadcrumb('Edit Geo Node')
end
end
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