diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-23 18:08:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-23 18:08:36 +0300 |
commit | 118083ac69c8cba0bc60633a15b9bb44e5f78281 (patch) | |
tree | 1e00c72fa30c952c9a8d86b3441132f037b3fc21 /spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/tags_list_row_spec.js | |
parent | 84b507d17bad7636a02ae2e9f59e8eb219ad7e15 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/tags_list_row_spec.js')
-rw-r--r-- | spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/tags_list_row_spec.js | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/tags_list_row_spec.js b/spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/tags_list_row_spec.js index 9f3431ef5a5..ef5fbbc418c 100644 --- a/spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/tags_list_row_spec.js +++ b/spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/tags_list_row_spec.js @@ -242,10 +242,20 @@ describe('tags list row', () => { expect(findTimeAgoTooltip().exists()).toBe(true); }); - it('pass the correct props to time ago tooltip', () => { + it('passes publishedAt value to time ago tooltip', () => { mountComponent(); - expect(findTimeAgoTooltip().attributes()).toMatchObject({ time: tag.createdAt }); + expect(findTimeAgoTooltip().attributes()).toMatchObject({ time: tag.publishedAt }); + }); + + describe('when publishedAt is missing', () => { + beforeEach(() => { + mountComponent({ ...defaultProps, tag: { ...tag, publishedAt: null } }); + }); + + it('passes createdAt value to time ago tooltip', () => { + expect(findTimeAgoTooltip().attributes()).toMatchObject({ time: tag.createdAt }); + }); }); }); @@ -351,7 +361,7 @@ describe('tags list row', () => { describe.each` name | finderFunction | text | icon | clipboard - ${'published date detail'} | ${findPublishedDateDetail} | ${'Published to the gitlab-org/gitlab-test/rails-12009 image repository at 13:29:38 UTC on 2020-11-03'} | ${'clock'} | ${false} + ${'published date detail'} | ${findPublishedDateDetail} | ${'Published to the gitlab-org/gitlab-test/rails-12009 image repository at 13:29:38 UTC on 2020-11-05'} | ${'clock'} | ${false} ${'manifest detail'} | ${findManifestDetail} | ${'Manifest digest: sha256:2cf3d2fdac1b04a14301d47d51cb88dcd26714c74f91440eeee99ce399089062'} | ${'log'} | ${true} ${'configuration detail'} | ${findConfigurationDetail} | ${'Configuration digest: sha256:c2613843ab33aabf847965442b13a8b55a56ae28837ce182627c0716eb08c02b'} | ${'cloud-gear'} | ${true} `('$name details row', ({ finderFunction, text, icon, clipboard }) => { @@ -387,6 +397,18 @@ describe('tags list row', () => { }); } }); + + describe('when publishedAt is missing', () => { + beforeEach(() => { + mountComponent({ ...defaultProps, tag: { ...tag, publishedAt: null } }); + }); + + it('name details row has correct text', () => { + expect(findPublishedDateDetail().text()).toMatchInterpolatedText( + 'Published to the gitlab-org/gitlab-test/rails-12009 image repository at 13:29:38 UTC on 2020-11-03', + ); + }); + }); }); describe('when the tag does not have a digest', () => { |