Commit da34b9fc authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch 'rename-blob-header-components' into 'master'

Rename blob edit component for better consistency

See merge request gitlab-org/gitlab!64036
parents 9c9d745a f779a43b
...@@ -7,13 +7,13 @@ import { SIMPLE_BLOB_VIEWER, RICH_BLOB_VIEWER } from '~/blob/components/constant ...@@ -7,13 +7,13 @@ import { SIMPLE_BLOB_VIEWER, RICH_BLOB_VIEWER } from '~/blob/components/constant
import createFlash from '~/flash'; import createFlash from '~/flash';
import { __ } from '~/locale'; import { __ } from '~/locale';
import blobInfoQuery from '../queries/blob_info.query.graphql'; import blobInfoQuery from '../queries/blob_info.query.graphql';
import BlobHeaderEdit from './blob_header_edit.vue'; import BlobEdit from './blob_edit.vue';
import BlobReplace from './blob_replace.vue'; import BlobReplace from './blob_replace.vue';
export default { export default {
components: { components: {
BlobHeader, BlobHeader,
BlobHeaderEdit, BlobEdit,
BlobReplace, BlobReplace,
BlobContent, BlobContent,
GlLoadingIcon, GlLoadingIcon,
...@@ -131,10 +131,7 @@ export default { ...@@ -131,10 +131,7 @@ export default {
@viewer-changed="switchViewer" @viewer-changed="switchViewer"
> >
<template #actions> <template #actions>
<blob-header-edit <blob-edit :edit-path="blobInfo.editBlobPath" :web-ide-path="blobInfo.ideEditPath" />
:edit-path="blobInfo.editBlobPath"
:web-ide-path="blobInfo.ideEditPath"
/>
<blob-replace <blob-replace
v-if="isLoggedIn" v-if="isLoggedIn"
:path="path" :path="path"
......
...@@ -4,7 +4,7 @@ import { nextTick } from 'vue'; ...@@ -4,7 +4,7 @@ import { nextTick } from 'vue';
import BlobContent from '~/blob/components/blob_content.vue'; import BlobContent from '~/blob/components/blob_content.vue';
import BlobHeader from '~/blob/components/blob_header.vue'; import BlobHeader from '~/blob/components/blob_header.vue';
import BlobContentViewer from '~/repository/components/blob_content_viewer.vue'; import BlobContentViewer from '~/repository/components/blob_content_viewer.vue';
import BlobHeaderEdit from '~/repository/components/blob_header_edit.vue'; import BlobEdit from '~/repository/components/blob_edit.vue';
import BlobReplace from '~/repository/components/blob_replace.vue'; import BlobReplace from '~/repository/components/blob_replace.vue';
let wrapper; let wrapper;
...@@ -78,7 +78,7 @@ const fullFactory = createFactory(mount); ...@@ -78,7 +78,7 @@ const fullFactory = createFactory(mount);
describe('Blob content viewer component', () => { describe('Blob content viewer component', () => {
const findLoadingIcon = () => wrapper.findComponent(GlLoadingIcon); const findLoadingIcon = () => wrapper.findComponent(GlLoadingIcon);
const findBlobHeader = () => wrapper.findComponent(BlobHeader); const findBlobHeader = () => wrapper.findComponent(BlobHeader);
const findBlobHeaderEdit = () => wrapper.findComponent(BlobHeaderEdit); const findBlobEdit = () => wrapper.findComponent(BlobEdit);
const findBlobContent = () => wrapper.findComponent(BlobContent); const findBlobContent = () => wrapper.findComponent(BlobContent);
const findBlobReplace = () => wrapper.findComponent(BlobReplace); const findBlobReplace = () => wrapper.findComponent(BlobReplace);
...@@ -177,7 +177,7 @@ describe('Blob content viewer component', () => { ...@@ -177,7 +177,7 @@ describe('Blob content viewer component', () => {
await nextTick(); await nextTick();
expect(findBlobHeaderEdit().props()).toMatchObject({ expect(findBlobEdit().props()).toMatchObject({
editPath: editBlobPath, editPath: editBlobPath,
webIdePath: ideEditPath, webIdePath: ideEditPath,
}); });
...@@ -194,7 +194,7 @@ describe('Blob content viewer component', () => { ...@@ -194,7 +194,7 @@ describe('Blob content viewer component', () => {
await nextTick(); await nextTick();
expect(findBlobHeaderEdit().props()).toMatchObject({ expect(findBlobEdit().props()).toMatchObject({
editPath: editBlobPath, editPath: editBlobPath,
webIdePath: ideEditPath, webIdePath: ideEditPath,
}); });
......
import { GlButton } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import BlobHeaderEdit from '~/repository/components/blob_header_edit.vue'; import BlobEdit from '~/repository/components/blob_edit.vue';
import WebIdeLink from '~/vue_shared/components/web_ide_link.vue'; import WebIdeLink from '~/vue_shared/components/web_ide_link.vue';
const DEFAULT_PROPS = { const DEFAULT_PROPS = {
...@@ -8,11 +8,11 @@ const DEFAULT_PROPS = { ...@@ -8,11 +8,11 @@ const DEFAULT_PROPS = {
webIdePath: 'some_file.js/ide/edit', webIdePath: 'some_file.js/ide/edit',
}; };
describe('BlobHeaderEdit component', () => { describe('BlobEdit component', () => {
let wrapper; let wrapper;
const createComponent = (consolidatedEditButton = false, props = {}) => { const createComponent = (consolidatedEditButton = false, props = {}) => {
wrapper = shallowMount(BlobHeaderEdit, { wrapper = shallowMount(BlobEdit, {
propsData: { propsData: {
...DEFAULT_PROPS, ...DEFAULT_PROPS,
...props, ...props,
......
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