Skip to content
代码片段 群组 项目
未验证 提交 9c380c63 编辑于 作者: Anna Vovchenko's avatar Anna Vovchenko 提交者: GitLab
浏览文件

Merge branch '451889-error-in-displaying-terraform-module-registry-in-ui' into 'master'

Handle missing pipeline user name in terraform registry UI

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/147865



Merged-by: default avatarAnna Vovchenko <avovchenko@gitlab.com>
Approved-by: default avatarAlex Pennells <apennells@gitlab.com>
Approved-by: default avatarAnna Vovchenko <avovchenko@gitlab.com>
Co-authored-by: default avatarRahul Chanila <rchanila@gitlab.com>
No related branches found
No related tags found
无相关合并请求
......@@ -56,7 +56,7 @@ export default {
},
computed: {
hasPipeline() {
return Boolean(this.packageEntity.pipeline);
return Boolean(this.packageEntity.pipeline?.user?.name);
},
hasProjectLink() {
return Boolean(this.packageEntity.project_path);
......
......@@ -62,9 +62,12 @@ exports[`packages_list_row renders 1`] = `
class="gl-align-items-center gl-display-flex gl-min-h-6"
>
<span>
<gl-sprintf-stub
message="Created %{timestamp}"
/>
Created
<span
title="December 10, 2015 at 12:00:00 AM GMT"
>
4 years ago
</span>
</span>
</div>
</div>
......
import { GlLink } from '@gitlab/ui';
import { GlLink, GlSprintf } from '@gitlab/ui';
import { nextTick } from 'vue';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
......@@ -9,7 +9,7 @@ import PackageTags from '~/packages_and_registries/shared/components/package_tag
import { PACKAGE_ERROR_STATUS } from '~/packages_and_registries/shared/constants';
import ListItem from '~/vue_shared/components/registry/list_item.vue';
import { packageList } from '../mock_data';
import { packageList, npmPackage } from '../mock_data';
describe('packages_list_row', () => {
let wrapper;
......@@ -40,6 +40,7 @@ describe('packages_list_row', () => {
stubs: {
ListItem,
InfrastructureIconAndName,
GlSprintf,
},
propsData: {
packageLink: 'foo',
......@@ -96,6 +97,24 @@ describe('packages_list_row', () => {
});
});
describe('published by author', () => {
it('shows the text when user is set', () => {
mountComponent({
packageEntity: { ...npmPackage },
});
expect(wrapper.text()).toContain('published by foo');
});
it('is hidden when user is null', () => {
mountComponent({
packageEntity: { ...npmPackage, pipeline: { ...npmPackage.pipeline, user: null } },
});
expect(wrapper.text()).not.toContain('published by');
});
});
describe('deleteAvailable', () => {
it('does not show when not set', () => {
mountComponent({ disableDelete: true });
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册