From 6438df3a1e0fb944485cebf07976160184697d72 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Wed, 20 Jan 2021 13:34:23 -0600 Subject: Add latest changes from gitlab-org/gitlab@13-8-stable-ee --- spec/frontend/repository/components/breadcrumbs_spec.js | 16 ++++------------ .../components/directory_download_links_spec.js | 5 ++++- spec/frontend/repository/components/last_commit_spec.js | 10 ++++++++++ spec/frontend/repository/utils/dom_spec.js | 2 +- 4 files changed, 19 insertions(+), 14 deletions(-) (limited to 'spec/frontend/repository') diff --git a/spec/frontend/repository/components/breadcrumbs_spec.js b/spec/frontend/repository/components/breadcrumbs_spec.js index 38e5c9aaca5..a0dc608ddc9 100644 --- a/spec/frontend/repository/components/breadcrumbs_spec.js +++ b/spec/frontend/repository/components/breadcrumbs_spec.js @@ -36,23 +36,15 @@ describe('Repository breadcrumbs component', () => { it('escapes hash in directory path', () => { factory('app/assets/javascripts#'); - expect( - vm - .findAll(RouterLinkStub) - .at(3) - .props('to'), - ).toEqual('/-/tree/app/assets/javascripts%23'); + expect(vm.findAll(RouterLinkStub).at(3).props('to')).toEqual( + '/-/tree/app/assets/javascripts%23', + ); }); it('renders last link as active', () => { factory('app/assets'); - expect( - vm - .findAll(RouterLinkStub) - .at(2) - .attributes('aria-current'), - ).toEqual('page'); + expect(vm.findAll(RouterLinkStub).at(2).attributes('aria-current')).toEqual('page'); }); it('does not render add to tree dropdown when permissions are false', () => { diff --git a/spec/frontend/repository/components/directory_download_links_spec.js b/spec/frontend/repository/components/directory_download_links_spec.js index 4d70b44de08..72c4165c2e9 100644 --- a/spec/frontend/repository/components/directory_download_links_spec.js +++ b/spec/frontend/repository/components/directory_download_links_spec.js @@ -7,7 +7,10 @@ function factory(currentPath) { vm = shallowMount(DirectoryDownloadLinks, { propsData: { currentPath, - links: [{ text: 'zip', path: 'http://test.com/' }, { text: 'tar', path: 'http://test.com/' }], + links: [ + { text: 'zip', path: 'http://test.com/' }, + { text: 'tar', path: 'http://test.com/' }, + ], }, }); } diff --git a/spec/frontend/repository/components/last_commit_spec.js b/spec/frontend/repository/components/last_commit_spec.js index ccba0982c26..fe77057c3d4 100644 --- a/spec/frontend/repository/components/last_commit_spec.js +++ b/spec/frontend/repository/components/last_commit_spec.js @@ -131,6 +131,16 @@ describe('Repository last commit component', () => { }); }); + it('strips the first newline of the description', async () => { + factory(createCommitData({ descriptionHtml: ' Update ADOPTERS.md' })); + + await vm.vm.$nextTick(); + + expect(vm.find('.commit-row-description').html()).toBe( + '
Update ADOPTERS.md
', + ); + }); + it('renders the signature HTML as returned by the backend', () => { factory(createCommitData({ signatureHtml: '' })); diff --git a/spec/frontend/repository/utils/dom_spec.js b/spec/frontend/repository/utils/dom_spec.js index 26ed57f0392..f9e619a82d1 100644 --- a/spec/frontend/repository/utils/dom_spec.js +++ b/spec/frontend/repository/utils/dom_spec.js @@ -1,5 +1,5 @@ import { TEST_HOST } from 'helpers/test_constants'; -import { setHTMLFixture } from '../../helpers/fixtures'; +import { setHTMLFixture } from 'helpers/fixtures'; import { updateElementsVisibility, updateFormAction } from '~/repository/utils/dom'; describe('updateElementsVisibility', () => { -- cgit v1.2.3