diff options
Diffstat (limited to 'spec/frontend/repository')
6 files changed, 51 insertions, 51 deletions
diff --git a/spec/frontend/repository/components/__snapshots__/last_commit_spec.js.snap b/spec/frontend/repository/components/__snapshots__/last_commit_spec.js.snap index cf2e6b00800..aaa8bf168f2 100644 --- a/spec/frontend/repository/components/__snapshots__/last_commit_spec.js.snap +++ b/spec/frontend/repository/components/__snapshots__/last_commit_spec.js.snap @@ -77,24 +77,31 @@ exports[`Repository last commit component renders commit widget 1`] = ` </gl-link-stub> </div> - <div - class="commit-sha-group d-flex" + <gl-button-group-stub + class="gl-ml-4 js-commit-sha-group" > - <div - class="label label-monospace monospace" + <gl-button-stub + buttontextclasses="" + category="primary" + class="gl-font-monospace" + data-testid="last-commit-id-label" + icon="" + label="true" + size="medium" + variant="default" > - - 12345678 - - </div> + 12345678 + </gl-button-stub> <clipboard-button-stub - cssclass="btn-default" + category="secondary" + class="input-group-text" + size="medium" text="123456789" title="Copy commit SHA" - tooltipplacement="bottom" + tooltipplacement="top" /> - </div> + </gl-button-group-stub> </div> </div> </div> @@ -181,24 +188,31 @@ exports[`Repository last commit component renders the signature HTML as returned </gl-link-stub> </div> - <div - class="commit-sha-group d-flex" + <gl-button-group-stub + class="gl-ml-4 js-commit-sha-group" > - <div - class="label label-monospace monospace" + <gl-button-stub + buttontextclasses="" + category="primary" + class="gl-font-monospace" + data-testid="last-commit-id-label" + icon="" + label="true" + size="medium" + variant="default" > - - 12345678 - - </div> + 12345678 + </gl-button-stub> <clipboard-button-stub - cssclass="btn-default" + category="secondary" + class="input-group-text" + size="medium" text="123456789" title="Copy commit SHA" - tooltipplacement="bottom" + tooltipplacement="top" /> - </div> + </gl-button-group-stub> </div> </div> </div> diff --git a/spec/frontend/repository/components/breadcrumbs_spec.js b/spec/frontend/repository/components/breadcrumbs_spec.js index ca4120576f5..38e5c9aaca5 100644 --- a/spec/frontend/repository/components/breadcrumbs_spec.js +++ b/spec/frontend/repository/components/breadcrumbs_spec.js @@ -1,5 +1,5 @@ import { shallowMount, RouterLinkStub } from '@vue/test-utils'; -import { GlDeprecatedDropdown } from '@gitlab/ui'; +import { GlDropdown } from '@gitlab/ui'; import Breadcrumbs from '~/repository/components/breadcrumbs.vue'; let vm; @@ -61,7 +61,7 @@ describe('Repository breadcrumbs component', () => { vm.setData({ userPermissions: { forkProject: false, createMergeRequestIn: false } }); return vm.vm.$nextTick(() => { - expect(vm.find(GlDeprecatedDropdown).exists()).toBe(false); + expect(vm.find(GlDropdown).exists()).toBe(false); }); }); @@ -71,7 +71,7 @@ describe('Repository breadcrumbs component', () => { vm.setData({ userPermissions: { forkProject: true, createMergeRequestIn: true } }); return vm.vm.$nextTick(() => { - expect(vm.find(GlDeprecatedDropdown).exists()).toBe(true); + expect(vm.find(GlDropdown).exists()).toBe(true); }); }); }); diff --git a/spec/frontend/repository/components/last_commit_spec.js b/spec/frontend/repository/components/last_commit_spec.js index c14a7f0e061..ccba0982c26 100644 --- a/spec/frontend/repository/components/last_commit_spec.js +++ b/spec/frontend/repository/components/last_commit_spec.js @@ -78,7 +78,7 @@ describe('Repository last commit component', () => { factory(); return vm.vm.$nextTick(() => { - expect(vm.find('.label-monospace').text()).toEqual('12345678'); + expect(vm.find('[data-testid="last-commit-id-label"]').text()).toEqual('12345678'); }); }); diff --git a/spec/frontend/repository/components/preview/__snapshots__/index_spec.js.snap b/spec/frontend/repository/components/preview/__snapshots__/index_spec.js.snap index 69b7a3931f8..23c06dc5e68 100644 --- a/spec/frontend/repository/components/preview/__snapshots__/index_spec.js.snap +++ b/spec/frontend/repository/components/preview/__snapshots__/index_spec.js.snap @@ -10,9 +10,10 @@ exports[`Repository file preview component renders file HTML 1`] = ` <div class="file-header-content" > - <i + <gl-icon-stub aria-hidden="true" - class="fa fa-file-text-o fa-fw" + name="doc-text" + size="16" /> <gl-link-stub diff --git a/spec/frontend/repository/log_tree_spec.js b/spec/frontend/repository/log_tree_spec.js index 954424b5c8a..ddc95feccd6 100644 --- a/spec/frontend/repository/log_tree_spec.js +++ b/spec/frontend/repository/log_tree_spec.js @@ -84,6 +84,14 @@ describe('fetchLogsTree', () => { expect(axios.get.mock.calls.length).toEqual(1); })); + it('calls axios for each path', () => + Promise.all([ + fetchLogsTree(client, '', '0', resolver), + fetchLogsTree(client, '/test', '0', resolver), + ]).then(() => { + expect(axios.get.mock.calls.length).toEqual(2); + })); + it('calls entry resolver', () => fetchLogsTree(client, '', '0', resolver).then(() => { expect(resolver.resolve).toHaveBeenCalledWith( diff --git a/spec/frontend/repository/utils/icon_spec.js b/spec/frontend/repository/utils/icon_spec.js deleted file mode 100644 index 3d84705f7ea..00000000000 --- a/spec/frontend/repository/utils/icon_spec.js +++ /dev/null @@ -1,23 +0,0 @@ -import { getIconName } from '~/repository/utils/icon'; - -describe('getIconName', () => { - // Tests the returning font awesome icon name - // We only test one for each file type to save testing a lot of different - // file types - it.each` - type | path | icon - ${'tree'} | ${''} | ${'folder'} - ${'commit'} | ${''} | ${'archive'} - ${'file'} | ${'test.pdf'} | ${'file-pdf-o'} - ${'file'} | ${'test.jpg'} | ${'file-image-o'} - ${'file'} | ${'test.zip'} | ${'file-archive-o'} - ${'file'} | ${'test.mp3'} | ${'file-audio-o'} - ${'file'} | ${'test.flv'} | ${'file-video-o'} - ${'file'} | ${'test.dotx'} | ${'file-word-o'} - ${'file'} | ${'test.xlsb'} | ${'file-excel-o'} - ${'file'} | ${'test.ppam'} | ${'file-powerpoint-o'} - ${'file'} | ${'test.js'} | ${'file-text-o'} - `('returns $icon for $type with path $path', ({ type, path, icon }) => { - expect(getIconName(type, path)).toEqual(icon); - }); -}); |