diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /spec/frontend/projects/terraform_notification/terraform_notification_spec.js | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'spec/frontend/projects/terraform_notification/terraform_notification_spec.js')
-rw-r--r-- | spec/frontend/projects/terraform_notification/terraform_notification_spec.js | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/spec/frontend/projects/terraform_notification/terraform_notification_spec.js b/spec/frontend/projects/terraform_notification/terraform_notification_spec.js index be34b207c4b..71c22998b08 100644 --- a/spec/frontend/projects/terraform_notification/terraform_notification_spec.js +++ b/spec/frontend/projects/terraform_notification/terraform_notification_spec.js @@ -5,19 +5,21 @@ import TerraformNotification from '~/projects/terraform_notification/components/ jest.mock('~/lib/utils/common_utils'); -const bannerDissmisedKey = 'terraform_notification_dismissed_for_project_1'; +const terraformImagePath = '/path/to/image'; +const bannerDismissedKey = 'terraform_notification_dismissed'; describe('TerraformNotificationBanner', () => { let wrapper; - const propsData = { - projectId: 1, + const provideData = { + terraformImagePath, + bannerDismissedKey, }; const findBanner = () => wrapper.findComponent(GlBanner); beforeEach(() => { wrapper = shallowMount(TerraformNotification, { - propsData, + provide: provideData, stubs: { GlBanner }, }); }); @@ -27,19 +29,6 @@ describe('TerraformNotificationBanner', () => { parseBoolean.mockReturnValue(false); }); - describe('when the dismiss cookie is set', () => { - beforeEach(() => { - parseBoolean.mockReturnValue(true); - wrapper = shallowMount(TerraformNotification, { - propsData, - }); - }); - - it('should not render the banner', () => { - expect(findBanner().exists()).toBe(false); - }); - }); - describe('when the dismiss cookie is not set', () => { it('should render the banner', () => { expect(findBanner().exists()).toBe(true); @@ -51,8 +40,8 @@ describe('TerraformNotificationBanner', () => { await findBanner().vm.$emit('close'); }); - it('should set the cookie with the bannerDissmisedKey', () => { - expect(setCookie).toHaveBeenCalledWith(bannerDissmisedKey, true); + it('should set the cookie with the bannerDismissedKey', () => { + expect(setCookie).toHaveBeenCalledWith(bannerDismissedKey, true); }); it('should remove the banner', () => { |