Skip to content
代码片段 群组 项目
提交 1a373a6a 编辑于 作者: Olena Horal-Koretska's avatar Olena Horal-Koretska
浏览文件

Merge branch '364609-partial-cleanup-tooltip-does-not-display-time' into 'master'

Fixes time in container registry partial cleanup tooltip

See merge request gitlab-org/gitlab!92243
No related branches found
No related tags found
无相关合并请求
......@@ -60,7 +60,7 @@ export default {
return this.$options.i18n[`CLEANUP_STATUS_${this.status}`];
},
calculatedTimeTilNextRun() {
return timeTilRun(this.expirationPolicy?.next_run);
return timeTilRun(this.expirationPolicy?.next_run_at);
},
expireIconName() {
return this.failedDelete ? 'expire' : 'clock';
......@@ -90,9 +90,9 @@ export default {
{{ statusText }}
</span>
<gl-icon
v-if="failedDelete"
v-if="failedDelete && calculatedTimeTilNextRun"
:id="iconId"
:size="14"
:size="16"
class="gl-text-gray-500"
data-testid="extra-info"
name="information-o"
......
......@@ -90,18 +90,26 @@ describe('cleanup_status', () => {
`(
'when the status is $status is $visible that the extra icon is visible',
({ status, visible }) => {
mountComponent({ status });
mountComponent({ status, expirationPolicy: { next_run_at: '2063-04-08T01:44:03Z' } });
expect(findExtraInfoIcon().exists()).toBe(visible);
},
);
it(`when the status is ${UNFINISHED_STATUS} & expirationPolicy does not exist the extra icon is not visible`, () => {
mountComponent({
status: UNFINISHED_STATUS,
});
expect(findExtraInfoIcon().exists()).toBe(false);
});
it(`has a popover with a learn more link and a time frame for the next run`, () => {
jest.spyOn(Date, 'now').mockImplementation(() => new Date('2063-04-04T00:42:00Z').getTime());
mountComponent({
status: UNFINISHED_STATUS,
expirationPolicy: { next_run: '2063-04-08T01:44:03Z' },
expirationPolicy: { next_run_at: '2063-04-08T01:44:03Z' },
});
expect(findPopover().exists()).toBe(true);
......@@ -113,7 +121,7 @@ describe('cleanup_status', () => {
it('id matches popover target attribute', () => {
mountComponent({
status: UNFINISHED_STATUS,
next_run_at: '2063-04-08T01:44:03Z',
expirationPolicy: { next_run_at: '2063-04-08T01:44:03Z' },
});
const id = findExtraInfoIcon().attributes('id');
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册