Commit 6e3ae3a1 authored by David Fernandez's avatar David Fernandez

Merge branch '321904-enable-combined-menu-ff-by-default' into 'master'

Enable combined_menu ff by default

See merge request gitlab-org/gitlab!61816
parents ff4a37dc bcfb1687
...@@ -22,6 +22,8 @@ export default { ...@@ -22,6 +22,8 @@ export default {
<gl-nav class="navbar-sub-nav"> <gl-nav class="navbar-sub-nav">
<gl-nav-item-dropdown <gl-nav-item-dropdown
:text="navData.activeTitle" :text="navData.activeTitle"
data-qa-selector="navbar_dropdown"
:data-qa-title="navData.activeTitle"
icon="hamburger" icon="hamburger"
menu-class="gl-mt-3! gl-max-w-none! gl-max-h-none! gl-sm-w-auto! js-top-nav-dropdown-menu" menu-class="gl-mt-3! gl-max-w-none! gl-max-h-none! gl-sm-w-auto! js-top-nav-dropdown-menu"
toggle-class="top-nav-toggle js-top-nav-dropdown-toggle gl-px-3!" toggle-class="top-nav-toggle js-top-nav-dropdown-toggle gl-px-3!"
......
...@@ -83,6 +83,7 @@ export default { ...@@ -83,6 +83,7 @@ export default {
:slot-key="activeView" :slot-key="activeView"
class="gl-w-grid-size-40 gl-overflow-hidden gl-py-3 gl-px-5" class="gl-w-grid-size-40 gl-overflow-hidden gl-py-3 gl-px-5"
data-testid="menu-subview" data-testid="menu-subview"
data-qa-selector="menu_subview_container"
> >
<template #projects> <template #projects>
<top-nav-container-view <top-nav-container-view
......
...@@ -276,7 +276,7 @@ module Nav ...@@ -276,7 +276,7 @@ module Nav
builder = ::Gitlab::Nav::TopNavMenuBuilder.new builder = ::Gitlab::Nav::TopNavMenuBuilder.new
builder.add_primary_menu_item(id: 'your', title: _('Your groups'), href: dashboard_groups_path) builder.add_primary_menu_item(id: 'your', title: _('Your groups'), href: dashboard_groups_path)
builder.add_primary_menu_item(id: 'explore', title: _('Explore groups'), href: explore_groups_path) builder.add_primary_menu_item(id: 'explore', title: _('Explore groups'), href: explore_groups_path)
builder.add_secondary_menu_item(id: 'create', title: _('Create group'), href: new_group_path(anchor: 'create-group-pane')) builder.add_secondary_menu_item(id: 'create', title: _('Create group'), href: new_group_path)
builder.build builder.build
end end
end end
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
-# [1]: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56587 -# [1]: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56587
%ul.list-unstyled.navbar-sub-nav %ul.list-unstyled.navbar-sub-nav
- if dashboard_nav_link?(:projects) - if dashboard_nav_link?(:projects)
= nav_link(path: ['root#index', 'projects#trending', 'projects#starred', 'dashboard/projects#index'], html_options: { id: 'nav-projects-dropdown', class: "home dropdown header-projects qa-projects-dropdown", data: { track_label: "projects_dropdown", track_event: "click_dropdown", track_experiment: "new_repo" } }) do = nav_link(path: ['root#index', 'projects#trending', 'projects#starred', 'dashboard/projects#index'], html_options: { id: 'nav-projects-dropdown', class: "home dropdown header-projects", data: { track_label: "projects_dropdown", track_event: "click_dropdown", track_experiment: "new_repo" } }) do
%button{ type: 'button', data: { toggle: "dropdown" } } %button{ type: 'button', data: { toggle: "dropdown" } }
= _('Projects') = _('Projects')
= sprite_icon('chevron-down', css_class: 'caret-down') = sprite_icon('chevron-down', css_class: 'caret-down')
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
= render "layouts/nav/projects_dropdown/show" = render "layouts/nav/projects_dropdown/show"
- if dashboard_nav_link?(:groups) - if dashboard_nav_link?(:groups)
= nav_link(controller: ['dashboard/groups', 'explore/groups'], html_options: { id: 'nav-groups-dropdown', class: "d-none d-md-block home dropdown header-groups qa-groups-dropdown", data: { track_label: "groups_dropdown", track_event: "click_dropdown" } }) do = nav_link(controller: ['dashboard/groups', 'explore/groups'], html_options: { id: 'nav-groups-dropdown', class: "d-none d-md-block home dropdown header-groups", data: { track_label: "groups_dropdown", track_event: "click_dropdown" } }) do
%button{ type: 'button', data: { toggle: "dropdown" } } %button{ type: 'button', data: { toggle: "dropdown" } }
= _('Groups') = _('Groups')
= sprite_icon('chevron-down', css_class: 'caret-down') = sprite_icon('chevron-down', css_class: 'caret-down')
...@@ -21,28 +21,28 @@ ...@@ -21,28 +21,28 @@
- if any_dashboard_nav_link?([:groups, :milestones, :activity, :snippets]) - if any_dashboard_nav_link?([:groups, :milestones, :activity, :snippets])
= nav_link(html_options: { id: 'nav-more-dropdown', class: "header-more dropdown", data: { track_label: "more_dropdown", track_event: "click_more_link" } }) do = nav_link(html_options: { id: 'nav-more-dropdown', class: "header-more dropdown", data: { track_label: "more_dropdown", track_event: "click_more_link" } }) do
%a{ href: "#", data: { toggle: "dropdown", qa_selector: 'more_dropdown' } } %a{ href: "#", data: { toggle: "dropdown" } }
= _('More') = _('More')
= sprite_icon('chevron-down', css_class: 'caret-down') = sprite_icon('chevron-down', css_class: 'caret-down')
.dropdown-menu .dropdown-menu
%ul %ul
- if dashboard_nav_link?(:groups) - if dashboard_nav_link?(:groups)
%li.d-md-none %li.d-md-none
= link_to dashboard_groups_path, class: 'dashboard-shortcuts-groups', data: { qa_selector: 'groups_link' } do = link_to dashboard_groups_path, class: 'dashboard-shortcuts-groups' do
= _('Groups') = _('Groups')
- if dashboard_nav_link?(:activity) - if dashboard_nav_link?(:activity)
= nav_link(path: 'dashboard#activity') do = nav_link(path: 'dashboard#activity') do
= link_to activity_dashboard_path, class: 'dashboard-shortcuts-activity', data: { qa_selector: 'activity_link' } do = link_to activity_dashboard_path, class: 'dashboard-shortcuts-activity' do
= _('Activity') = _('Activity')
- if dashboard_nav_link?(:milestones) - if dashboard_nav_link?(:milestones)
= nav_link(controller: 'dashboard/milestones') do = nav_link(controller: 'dashboard/milestones') do
= link_to dashboard_milestones_path, class: 'dashboard-shortcuts-milestones', data: { qa_selector: 'milestones_link' } do = link_to dashboard_milestones_path, class: 'dashboard-shortcuts-milestones' do
= _('Milestones') = _('Milestones')
- if dashboard_nav_link?(:snippets) - if dashboard_nav_link?(:snippets)
= nav_link(controller: 'dashboard/snippets') do = nav_link(controller: 'dashboard/snippets') do
= link_to dashboard_snippets_path, class: 'dashboard-shortcuts-snippets', data: { qa_selector: 'snippets_link' } do = link_to dashboard_snippets_path, class: 'dashboard-shortcuts-snippets' do
= _('Snippets') = _('Snippets')
%li.dropdown %li.dropdown
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
- if current_user.admin? - if current_user.admin?
= nav_link(controller: 'admin/dashboard') do = nav_link(controller: 'admin/dashboard') do
= link_to admin_root_path, class: 'admin-icon qa-admin-area-link d-xl-none' do = link_to admin_root_path, class: 'admin-icon d-xl-none' do
= _('Admin Area') = _('Admin Area')
- if Gitlab::CurrentSettings.admin_mode - if Gitlab::CurrentSettings.admin_mode
- if header_link?(:admin_mode) - if header_link?(:admin_mode)
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
- if current_user.admin? - if current_user.admin?
= nav_link(controller: 'admin/dashboard', html_options: { class: "d-none d-xl-block"}) do = nav_link(controller: 'admin/dashboard', html_options: { class: "d-none d-xl-block"}) do
= link_to admin_root_path, class: 'admin-icon qa-admin-area-link', title: _('Admin Area'), aria: { label: _('Admin Area') }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do = link_to admin_root_path, class: 'admin-icon', title: _('Admin Area'), aria: { label: _('Admin Area') }, data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do
= sprite_icon('admin', size: 18) = sprite_icon('admin', size: 18)
- if Gitlab::CurrentSettings.admin_mode - if Gitlab::CurrentSettings.admin_mode
......
...@@ -4,19 +4,19 @@ ...@@ -4,19 +4,19 @@
-# [1]: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56587 -# [1]: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56587
- group_meta = { id: @group.id, name: @group.name, namespace: @group.full_name, web_url: group_path(@group), avatar_url: @group.avatar_url } if @group&.persisted? - group_meta = { id: @group.id, name: @group.name, namespace: @group.full_name, web_url: group_path(@group), avatar_url: @group.avatar_url } if @group&.persisted?
.frequent-items-dropdown-container.with-deprecated-styles .frequent-items-dropdown-container.with-deprecated-styles
.frequent-items-dropdown-sidebar.qa-groups-dropdown-sidebar .frequent-items-dropdown-sidebar
%ul %ul
= nav_link(path: 'dashboard/groups#index') do = nav_link(path: 'dashboard/groups#index') do
= link_to dashboard_groups_path, class: 'qa-your-groups-link', data: { track_label: "groups_dropdown_your_groups", track_event: "click_link" } do = link_to dashboard_groups_path, data: { track_label: "groups_dropdown_your_groups", track_event: "click_link" } do
= _('Your groups') = _('Your groups')
= nav_link(path: 'groups#explore') do = nav_link(path: 'groups#explore') do
= link_to explore_groups_path, data: { track_label: "groups_dropdown_explore_groups", track_event: "click_link" } do = link_to explore_groups_path, data: { track_label: "groups_dropdown_explore_groups", track_event: "click_link" } do
= _('Explore groups') = _('Explore groups')
= nav_link(path: 'groups/new#create-group-pane', html_options: { class: 'gl-border-0 gl-border-t-1 gl-border-solid gl-border-gray-100' }) do = nav_link(path: 'groups/new#create-group-pane', html_options: { class: 'gl-border-0 gl-border-t-1 gl-border-solid gl-border-gray-100' }) do
= link_to new_group_path(anchor: 'create-group-pane'), data: { track_label: "groups_dropdown_create_group", track_event: "click_link", qa_selector: 'create_group_link' } do = link_to new_group_path(anchor: 'create-group-pane'), data: { track_label: "groups_dropdown_create_group", track_event: "click_link" } do
= _('Create group') = _('Create group')
= nav_link(path: 'groups/new#import-group-pane') do = nav_link(path: 'groups/new#import-group-pane') do
= link_to new_group_path(anchor: 'import-group-pane'), data: { track_label: "groups_dropdown_import_group", track_event: "click_link", qa_selector: 'import_group_link' } do = link_to new_group_path(anchor: 'import-group-pane'), data: { track_label: "groups_dropdown_import_group", track_event: "click_link" } do
= _('Import group') = _('Import group')
.frequent-items-dropdown-content .frequent-items-dropdown-content
#js-groups-dropdown{ data: { user_name: current_user.username, group: group_meta } } #js-groups-dropdown{ data: { user_name: current_user.username, group: group_meta } }
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
-# [1]: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56587 -# [1]: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56587
- project_meta = { id: @project.id, name: @project.name, namespace: @project.full_name, web_url: project_path(@project), avatar_url: @project.avatar_url } if @project&.persisted? - project_meta = { id: @project.id, name: @project.name, namespace: @project.full_name, web_url: project_path(@project), avatar_url: @project.avatar_url } if @project&.persisted?
.frequent-items-dropdown-container.with-deprecated-styles .frequent-items-dropdown-container.with-deprecated-styles
.frequent-items-dropdown-sidebar.qa-projects-dropdown-sidebar .frequent-items-dropdown-sidebar
%ul %ul
= nav_link(path: 'dashboard/projects#index') do = nav_link(path: 'dashboard/projects#index') do
= link_to dashboard_projects_path, class: 'qa-your-projects-link', data: { track_label: "projects_dropdown_your_projects", track_event: "click_link" } do = link_to dashboard_projects_path, data: { track_label: "projects_dropdown_your_projects", track_event: "click_link" } do
= _('Your projects') = _('Your projects')
= nav_link(path: 'projects#starred') do = nav_link(path: 'projects#starred') do
= link_to starred_dashboard_projects_path, data: { track_label: "projects_dropdown_starred_projects", track_event: "click_link" } do = link_to starred_dashboard_projects_path, data: { track_label: "projects_dropdown_starred_projects", track_event: "click_link" } do
......
...@@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/324086 ...@@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/324086
milestone: '13.10' milestone: '13.10'
type: development type: development
group: group::editor group: group::editor
default_enabled: false default_enabled: true
...@@ -8,7 +8,7 @@ module Gitlab ...@@ -8,7 +8,7 @@ module Gitlab
# this is already :/. We could also take a hash and manually check every # this is already :/. We could also take a hash and manually check every
# entry, but it's much more maintainable to do rely on native Ruby. # entry, but it's much more maintainable to do rely on native Ruby.
# rubocop: disable Metrics/ParameterLists # rubocop: disable Metrics/ParameterLists
def self.build(id:, title:, active: false, icon: '', href: '', view: '', css_class: nil, data: {}, emoji: nil) def self.build(id:, title:, active: false, icon: '', href: '', view: '', css_class: nil, data: nil, emoji: nil)
{ {
id: id, id: id,
title: title, title: title,
...@@ -17,7 +17,7 @@ module Gitlab ...@@ -17,7 +17,7 @@ module Gitlab
href: href, href: href,
view: view.to_s, view: view.to_s,
css_class: css_class, css_class: css_class,
data: data, data: data || { qa_selector: 'menu_item_link', qa_title: title },
emoji: emoji emoji: emoji
} }
end end
......
...@@ -60,6 +60,10 @@ module QA ...@@ -60,6 +60,10 @@ module QA
click_element(:connect_instance_button) click_element(:connect_instance_button)
end end
def switch_to_import_tab
click_element("import-group-pane_link")
end
end end
end end
end end
......
...@@ -19,25 +19,23 @@ module QA ...@@ -19,25 +19,23 @@ module QA
element :todos_shortcut_button, required: true element :todos_shortcut_button, required: true
end end
view 'app/views/layouts/nav/_dashboard.html.haml' do view 'app/assets/javascripts/nav/components/top_nav_app.vue' do
element :admin_area_link element :navbar_dropdown
element :projects_dropdown, required: true
element :groups_dropdown, required: true
element :more_dropdown
element :snippets_link
element :groups_link
element :activity_link
element :milestones_link
end end
view 'app/views/layouts/nav/projects_dropdown/_show.html.haml' do view 'app/assets/javascripts/nav/components/top_nav_dropdown_menu.vue' do
element :projects_dropdown_sidebar element :menu_subview_container
element :your_projects_link
end end
view 'app/views/layouts/nav/groups_dropdown/_show.html.haml' do view 'lib/gitlab/nav/top_nav_menu_item.rb' do
element :create_group_link element :menu_item_link
element :import_group_link end
view 'app/helpers/nav/top_nav_helper.rb' do
element :admin_area_link
element :projects_dropdown
element :groups_dropdown
element :snippets_link
end end
view 'app/views/layouts/_search.html.haml' do view 'app/views/layouts/_search.html.haml' do
...@@ -46,30 +44,28 @@ module QA ...@@ -46,30 +44,28 @@ module QA
def go_to_groups def go_to_groups
within_groups_menu do within_groups_menu do
click_element :your_groups_link click_element(:menu_item_link, title: 'Your groups')
end end
end end
def go_to_import_group def go_to_create_group
within_groups_menu do within_groups_menu do
click_element :import_group_link click_element(:menu_item_link, title: 'Create group')
end end
end end
def go_to_projects def go_to_projects
within_top_menu do go_to_menu_dropdown_option(:projects_dropdown)
click_element :projects_dropdown
end
page.within('.qa-projects-dropdown-sidebar') do within_element(:menu_subview_container) do
click_element :your_projects_link click_element(:menu_item_link, title: 'Your projects')
end end
end end
def go_to_more_dropdown_option(option_name) def go_to_menu_dropdown_option(option_name)
within_top_menu do within_top_menu do
click_element :more_dropdown click_element(:navbar_dropdown, title: 'Menu')
click_element option_name click_element(option_name)
end end
end end
...@@ -151,11 +147,17 @@ module QA ...@@ -151,11 +147,17 @@ module QA
end end
def has_admin_area_link?(wait: Capybara.default_max_wait_time) def has_admin_area_link?(wait: Capybara.default_max_wait_time)
has_element?(:admin_area_link, wait: wait) within_top_menu do
click_element(:navbar_dropdown, title: 'Menu')
has_element?(:admin_area_link, wait: wait)
end
end end
def has_no_admin_area_link?(wait: Capybara.default_max_wait_time) def has_no_admin_area_link?(wait: Capybara.default_max_wait_time)
has_no_element?(:admin_area_link, wait: wait) within_top_menu do
click_element(:navbar_dropdown, title: 'Menu')
has_no_element?(:admin_area_link, wait: wait)
end
end end
def click_stop_impersonation_link def click_stop_impersonation_link
...@@ -181,15 +183,13 @@ module QA ...@@ -181,15 +183,13 @@ module QA
end end
def within_groups_menu(&block) def within_groups_menu(&block)
within_top_menu do go_to_menu_dropdown_option(:groups_dropdown)
click_element :groups_dropdown
end
page.within('.qa-groups-dropdown-sidebar', &block) within_element(:menu_subview_container, &block)
end end
def click_admin_area def click_admin_area
within_top_menu { click_element :admin_area_link } go_to_menu_dropdown_option(:admin_area_link)
end end
end end
end end
......
...@@ -64,8 +64,11 @@ module QA ...@@ -64,8 +64,11 @@ module QA
sandbox.add_member(user, Resource::Members::AccessLevel::MAINTAINER) sandbox.add_member(user, Resource::Members::AccessLevel::MAINTAINER)
Flow::Login.sign_in(as: user) Flow::Login.sign_in(as: user)
Page::Main::Menu.new.go_to_import_group Page::Main::Menu.perform(&:go_to_create_group)
Page::Group::New.new.connect_gitlab_instance(Runtime::Scenario.gitlab_address, personal_access_token) Page::Group::New.perform do |group|
group.switch_to_import_tab
group.connect_gitlab_instance(Runtime::Scenario.gitlab_address, personal_access_token)
end
end end
# Non blocking issues: # Non blocking issues:
......
...@@ -7,7 +7,7 @@ module QA ...@@ -7,7 +7,7 @@ module QA
Flow::Login.sign_in Flow::Login.sign_in
Page::Main::Menu.perform do |menu| Page::Main::Menu.perform do |menu|
menu.go_to_more_dropdown_option(:snippets_link) menu.go_to_menu_dropdown_option(:snippets_link)
end end
Resource::Snippet.fabricate_via_browser_ui! do |snippet| Resource::Snippet.fabricate_via_browser_ui! do |snippet|
......
...@@ -7,7 +7,7 @@ module QA ...@@ -7,7 +7,7 @@ module QA
Flow::Login.sign_in Flow::Login.sign_in
Page::Main::Menu.perform do |menu| Page::Main::Menu.perform do |menu|
menu.go_to_more_dropdown_option(:snippets_link) menu.go_to_menu_dropdown_option(:snippets_link)
end end
Resource::Snippet.fabricate_via_browser_ui! do |snippet| Resource::Snippet.fabricate_via_browser_ui! do |snippet|
......
...@@ -60,7 +60,7 @@ module QA ...@@ -60,7 +60,7 @@ module QA
it "shows correct details of #{snippet_type} including file number" do it "shows correct details of #{snippet_type} including file number" do
send(snippet_type) send(snippet_type)
Page::Main::Menu.perform do |menu| Page::Main::Menu.perform do |menu|
menu.go_to_more_dropdown_option(:snippets_link) menu.go_to_menu_dropdown_option(:snippets_link)
end end
Page::Dashboard::Snippet::Index.perform do |snippet| Page::Dashboard::Snippet::Index.perform do |snippet|
......
...@@ -45,7 +45,7 @@ module QA ...@@ -45,7 +45,7 @@ module QA
Flow::Login.sign_in Flow::Login.sign_in
setup_projects setup_projects
Page::Main::Menu.perform do |menu| Page::Main::Menu.perform do |menu|
menu.go_to_more_dropdown_option(:operations_link) menu.go_to_menu_dropdown_option(:operations_link)
end end
end end
......
...@@ -97,17 +97,17 @@ RSpec.describe 'Admin mode' do ...@@ -97,17 +97,17 @@ RSpec.describe 'Admin mode' do
end end
it 'can leave admin mode using dropdown menu on smaller screens', :js do it 'can leave admin mode using dropdown menu on smaller screens', :js do
skip('pending responsive development under :combined_menu feature flag') if Feature.enabled?(:combined_menu) skip('pending responsive development under :combined_menu feature flag') if Feature.enabled?(:combined_menu, default_enabled: :yaml)
resize_screen_xs resize_screen_xs
visit root_dashboard_path visit root_dashboard_path
find('.header-more').click unless Feature.enabled?(:combined_menu) find('.header-more').click unless Feature.enabled?(:combined_menu, default_enabled: :yaml)
gitlab_disable_admin_mode gitlab_disable_admin_mode
open_top_nav open_top_nav
find('.header-more').click unless Feature.enabled?(:combined_menu) find('.header-more').click unless Feature.enabled?(:combined_menu, default_enabled: :yaml)
expect(page).to have_link(href: new_admin_session_path) expect(page).to have_link(href: new_admin_session_path)
end end
...@@ -127,13 +127,13 @@ RSpec.describe 'Admin mode' do ...@@ -127,13 +127,13 @@ RSpec.describe 'Admin mode' do
visit root_dashboard_path visit root_dashboard_path
open_top_nav open_top_nav
link_text = Feature.enabled?(:combined_menu) ? 'Admin' : 'Admin Area' link_text = Feature.enabled?(:combined_menu, default_enabled: :yaml) ? 'Admin' : 'Admin Area'
expect(page).to have_link(text: link_text, href: admin_root_path, visible: true) expect(page).to have_link(text: link_text, href: admin_root_path, visible: true)
expect(page).to have_link(text: 'Leave Admin Mode', href: destroy_admin_session_path, visible: true) expect(page).to have_link(text: 'Leave Admin Mode', href: destroy_admin_session_path, visible: true)
end end
it 'relocates admin dashboard links to dropdown list on smaller screen', :js do it 'relocates admin dashboard links to dropdown list on smaller screen', :js do
skip('pending responsive development under :combined_menu feature flag') if Feature.enabled?(:combined_menu) skip('pending responsive development under :combined_menu feature flag') if Feature.enabled?(:combined_menu, default_enabled: :yaml)
resize_screen_xs resize_screen_xs
visit root_dashboard_path visit root_dashboard_path
......
...@@ -53,7 +53,7 @@ RSpec.describe 'New project', :js do ...@@ -53,7 +53,7 @@ RSpec.describe 'New project', :js do
open_top_nav_projects open_top_nav_projects
within_top_nav do within_top_nav do
if Feature.enabled?(:combined_menu) if Feature.enabled?(:combined_menu, default_enabled: :yaml)
expect(page).to have_selector('a', text: 'Create new project') expect(page).to have_selector('a', text: 'Create new project')
expect(page).to have_no_selector('a', text: 'Create blank project/repository') expect(page).to have_no_selector('a', text: 'Create blank project/repository')
else else
...@@ -73,7 +73,7 @@ RSpec.describe 'New project', :js do ...@@ -73,7 +73,7 @@ RSpec.describe 'New project', :js do
open_top_nav_projects open_top_nav_projects
within_top_nav do within_top_nav do
if Feature.enabled?(:combined_menu) if Feature.enabled?(:combined_menu, default_enabled: :yaml)
expect(page).to have_selector('a', text: 'Create new project') expect(page).to have_selector('a', text: 'Create new project')
else else
expect(page).to have_selector('a', text: 'Create blank project/repository') expect(page).to have_selector('a', text: 'Create blank project/repository')
......
...@@ -297,7 +297,7 @@ RSpec.describe Nav::TopNavHelper do ...@@ -297,7 +297,7 @@ RSpec.describe Nav::TopNavHelper do
it 'has expected :linksSecondary' do it 'has expected :linksSecondary' do
expected_links_secondary = [ expected_links_secondary = [
::Gitlab::Nav::TopNavMenuItem.build( ::Gitlab::Nav::TopNavMenuItem.build(
href: '/groups/new#create-group-pane', href: '/groups/new',
id: 'create', id: 'create',
title: 'Create group' title: 'Create group'
) )
......
...@@ -8,13 +8,13 @@ module Spec ...@@ -8,13 +8,13 @@ module Spec
module Features module Features
module TopNavSpecHelpers module TopNavSpecHelpers
def open_top_nav def open_top_nav
return unless Feature.enabled?(:combined_menu) return unless Feature.enabled?(:combined_menu, default_enabled: :yaml)
find('.js-top-nav-dropdown-toggle').click find('.js-top-nav-dropdown-toggle').click
end end
def within_top_nav def within_top_nav
if Feature.enabled?(:combined_menu) if Feature.enabled?(:combined_menu, default_enabled: :yaml)
within('.js-top-nav-dropdown-menu') do within('.js-top-nav-dropdown-menu') do
yield yield
end end
...@@ -26,7 +26,7 @@ module Spec ...@@ -26,7 +26,7 @@ module Spec
end end
def open_top_nav_projects def open_top_nav_projects
if Feature.enabled?(:combined_menu) if Feature.enabled?(:combined_menu, default_enabled: :yaml)
open_top_nav open_top_nav
within_top_nav do within_top_nav do
...@@ -38,7 +38,7 @@ module Spec ...@@ -38,7 +38,7 @@ module Spec
end end
def open_top_nav_groups def open_top_nav_groups
return unless Feature.enabled?(:combined_menu) return unless Feature.enabled?(:combined_menu, default_enabled: :yaml)
open_top_nav open_top_nav
......
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