diff --git a/app/assets/javascripts/packages_and_registries/container_registry/explorer/components/list_page/cleanup_status.vue b/app/assets/javascripts/packages_and_registries/container_registry/explorer/components/list_page/cleanup_status.vue index bfa99c01c3f17699ffe49a9703212c2fc8bf9915..ce221a274c97909705256fb4b5a1da05ec248c3e 100644 --- a/app/assets/javascripts/packages_and_registries/container_registry/explorer/components/list_page/cleanup_status.vue +++ b/app/assets/javascripts/packages_and_registries/container_registry/explorer/components/list_page/cleanup_status.vue @@ -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" diff --git a/spec/frontend/packages_and_registries/container_registry/explorer/components/list_page/cleanup_status_spec.js b/spec/frontend/packages_and_registries/container_registry/explorer/components/list_page/cleanup_status_spec.js index a5b2b1d7cf87a68c9966e5544d46cbcdaf823aca..61503d0f3bfb2fe83b58f8c5286102ba20d11876 100644 --- a/spec/frontend/packages_and_registries/container_registry/explorer/components/list_page/cleanup_status_spec.js +++ b/spec/frontend/packages_and_registries/container_registry/explorer/components/list_page/cleanup_status_spec.js @@ -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');