Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/users/profile/components/report_abuse_button_spec.js')
-rw-r--r--spec/frontend/users/profile/components/report_abuse_button_spec.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/frontend/users/profile/components/report_abuse_button_spec.js b/spec/frontend/users/profile/components/report_abuse_button_spec.js
index 1ef856c9849..1ca944dce12 100644
--- a/spec/frontend/users/profile/components/report_abuse_button_spec.js
+++ b/spec/frontend/users/profile/components/report_abuse_button_spec.js
@@ -1,7 +1,7 @@
import { GlButton } from '@gitlab/ui';
+import { createWrapper } from '@vue/test-utils';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import { BV_HIDE_TOOLTIP } from '~/lib/utils/constants';
-
import ReportAbuseButton from '~/users/profile/components/report_abuse_button.vue';
import AbuseCategorySelector from '~/abuse_reports/components/abuse_category_selector.vue';
@@ -41,7 +41,7 @@ describe('ReportAbuseButton', () => {
});
expect(findReportAbuseButton().attributes('aria-label')).toBe(
- wrapper.vm.$options.i18n.reportAbuse,
+ ReportAbuseButton.i18n.reportAbuse,
);
});
@@ -69,11 +69,11 @@ describe('ReportAbuseButton', () => {
describe('when user hovers out of the button', () => {
it(`should emit ${BV_HIDE_TOOLTIP} to close the tooltip`, () => {
- jest.spyOn(wrapper.vm.$root, '$emit');
+ const rootWrapper = createWrapper(wrapper.vm.$root);
findReportAbuseButton().vm.$emit('mouseout');
- expect(wrapper.vm.$root.$emit).toHaveBeenCalledWith(BV_HIDE_TOOLTIP);
+ expect(rootWrapper.emitted(BV_HIDE_TOOLTIP)).toHaveLength(1);
});
});
});