diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-31 03:10:33 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-31 03:10:33 +0300 |
commit | 13ddda5208f9175e822af6d05a32600bc9cad091 (patch) | |
tree | d0dede48f80b34cfbf326d9539edc2e2addf4398 /spec/frontend/releases/components/app_index_spec.js | |
parent | dd8c199e989482245c58ee49b5f7169bdd9073eb (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/releases/components/app_index_spec.js')
-rw-r--r-- | spec/frontend/releases/components/app_index_spec.js | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/spec/frontend/releases/components/app_index_spec.js b/spec/frontend/releases/components/app_index_spec.js index 48589a54ec4..ef3bd5ca873 100644 --- a/spec/frontend/releases/components/app_index_spec.js +++ b/spec/frontend/releases/components/app_index_spec.js @@ -92,10 +92,6 @@ describe('app_index.vue', () => { queryMock = jest.fn(); }); - afterEach(() => { - wrapper.destroy(); - }); - // Finders const findLoadingIndicator = () => wrapper.findComponent(ReleaseSkeletonLoader); const findEmptyState = () => wrapper.findComponent(ReleasesEmptyState); @@ -179,12 +175,14 @@ describe('app_index.vue', () => { expect(findPagination().exists()).toBe(pagination); }); - it('does render the "New release" button', () => { - expect(findNewReleaseButton().exists()).toBe(true); + it('does render the "New release" button only for non-empty state', () => { + const shouldRenderNewReleaseButton = !emptyState; + expect(findNewReleaseButton().exists()).toBe(shouldRenderNewReleaseButton); }); - it('does render the sort controls', () => { - expect(findSort().exists()).toBe(true); + it('does render the sort controls only for non-empty state', () => { + const shouldRenderControls = !emptyState; + expect(findSort().exists()).toBe(shouldRenderControls); }); }, ); |