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/vue_shared/directives/safe_html_spec.js')
-rw-r--r--spec/frontend/vue_shared/directives/safe_html_spec.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/frontend/vue_shared/directives/safe_html_spec.js b/spec/frontend/vue_shared/directives/safe_html_spec.js
index ba1de8e4596..21df11fcc98 100644
--- a/spec/frontend/vue_shared/directives/safe_html_spec.js
+++ b/spec/frontend/vue_shared/directives/safe_html_spec.js
@@ -113,4 +113,21 @@ describe('safe html directive', () => {
expect(wrapper.html()).toEqual('<div>click here</div>');
});
});
+
+ describe('unbind', () => {
+ it('should clear the text content during unbind', () => {
+ createComponent();
+ wrapper.destroy();
+
+ expect(wrapper.element.textContent).toEqual('');
+ });
+
+ it('should clear the text content with custom HTML during unbind', () => {
+ const customHtml = '<div>custom html</div>';
+ createComponent({ html: customHtml });
+ wrapper.destroy();
+
+ expect(wrapper.element.textContent).toEqual('');
+ });
+ });
});