diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-14 12:10:34 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-14 12:10:34 +0300 |
commit | 66f492cea7772633bfb6e0cb1352d90d10a67008 (patch) | |
tree | 3899ce7c865a3f3ae1a68dc8e5eade7572b7d953 /spec | |
parent | 89528516610699b580e6ea925312f08a9fdb44ce (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/projects/terraform_spec.rb | 2 | ||||
-rw-r--r-- | spec/frontend/sidebar/participants_spec.js | 5 | ||||
-rw-r--r-- | spec/frontend/terraform/components/empty_state_spec.js | 13 | ||||
-rw-r--r-- | spec/support/helpers/navbar_structure_helper.rb | 12 | ||||
-rw-r--r-- | spec/support/shared_contexts/navbar_structure_context.rb | 10 |
5 files changed, 27 insertions, 15 deletions
diff --git a/spec/features/projects/terraform_spec.rb b/spec/features/projects/terraform_spec.rb index 2c63f2bfc02..d9e45b5e78e 100644 --- a/spec/features/projects/terraform_spec.rb +++ b/spec/features/projects/terraform_spec.rb @@ -22,7 +22,7 @@ RSpec.describe 'Terraform', :js do end it 'sees an empty state' do - expect(page).to have_content('Get started with Terraform') + expect(page).to have_content("Your project doesn't have any Terraform state files") end end diff --git a/spec/frontend/sidebar/participants_spec.js b/spec/frontend/sidebar/participants_spec.js index 356628849d9..2517b625225 100644 --- a/spec/frontend/sidebar/participants_spec.js +++ b/spec/frontend/sidebar/participants_spec.js @@ -17,8 +17,7 @@ const PARTICIPANT_LIST = [PARTICIPANT, { ...PARTICIPANT, id: 2 }, { ...PARTICIPA describe('Participants', () => { let wrapper; - const getMoreParticipantsButton = () => wrapper.find('button'); - + const getMoreParticipantsButton = () => wrapper.find('[data-testid="more-participants"]'); const getCollapsedParticipantsCount = () => wrapper.find('[data-testid="collapsed-count"]'); const mountComponent = (propsData) => @@ -167,7 +166,7 @@ describe('Participants', () => { expect(wrapper.vm.isShowingMoreParticipants).toBe(false); - getMoreParticipantsButton().trigger('click'); + getMoreParticipantsButton().vm.$emit('click'); expect(wrapper.vm.isShowingMoreParticipants).toBe(true); }); diff --git a/spec/frontend/terraform/components/empty_state_spec.js b/spec/frontend/terraform/components/empty_state_spec.js index b1303cf2b5e..21bfff5f1be 100644 --- a/spec/frontend/terraform/components/empty_state_spec.js +++ b/spec/frontend/terraform/components/empty_state_spec.js @@ -13,15 +13,20 @@ describe('EmptyStateComponent', () => { const findLink = () => wrapper.findComponent(GlLink); beforeEach(() => { - wrapper = shallowMount(EmptyState, { propsData, stubs: { GlEmptyState, GlLink } }); + wrapper = shallowMount(EmptyState, { propsData }); + }); + + afterEach(() => { + wrapper.destroy(); }); it('should render content', () => { - expect(findEmptyState().exists()).toBe(true); - expect(wrapper.text()).toContain('Get started with Terraform'); + expect(findEmptyState().props('title')).toBe( + "Your project doesn't have any Terraform state files", + ); }); - it('should have a link to the GitLab managed Terraform States docs', () => { + it('should have a link to the GitLab managed Terraform states docs', () => { expect(findLink().attributes('href')).toBe(docsUrl); }); }); diff --git a/spec/support/helpers/navbar_structure_helper.rb b/spec/support/helpers/navbar_structure_helper.rb index fb06ebfdae2..315303401cc 100644 --- a/spec/support/helpers/navbar_structure_helper.rb +++ b/spec/support/helpers/navbar_structure_helper.rb @@ -92,4 +92,16 @@ module NavbarStructureHelper new_sub_nav_item_name: _('Google Cloud') ) end + + def analytics_sub_nav_item + [ + _('Value stream'), + _('CI/CD'), + (_('Code review') if Gitlab.ee?), + (_('Merge request') if Gitlab.ee?), + _('Repository') + ] + end end + +NavbarStructureHelper.prepend_mod diff --git a/spec/support/shared_contexts/navbar_structure_context.rb b/spec/support/shared_contexts/navbar_structure_context.rb index b4a71f52092..65c7f63cf6e 100644 --- a/spec/support/shared_contexts/navbar_structure_context.rb +++ b/spec/support/shared_contexts/navbar_structure_context.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true RSpec.shared_context 'project navbar structure' do + include NavbarStructureHelper + let(:security_and_compliance_nav_item) do { nav_item: _('Security & Compliance'), @@ -93,13 +95,7 @@ RSpec.shared_context 'project navbar structure' do }, { nav_item: _('Analytics'), - nav_sub_items: [ - _('Value stream'), - _('CI/CD'), - (_('Code review') if Gitlab.ee?), - (_('Merge request') if Gitlab.ee?), - _('Repository') - ] + nav_sub_items: analytics_sub_nav_item }, { nav_item: _('Wiki'), |