summaryrefslogtreecommitdiff
path: root/spec/frontend/notes/components/note_header_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/notes/components/note_header_spec.js')
-rw-r--r--spec/frontend/notes/components/note_header_spec.js28
1 files changed, 16 insertions, 12 deletions
diff --git a/spec/frontend/notes/components/note_header_spec.js b/spec/frontend/notes/components/note_header_spec.js
index 4671d33219d..3513b562e0a 100644
--- a/spec/frontend/notes/components/note_header_spec.js
+++ b/spec/frontend/notes/components/note_header_spec.js
@@ -263,7 +263,7 @@ describe('NoteHeader component', () => {
});
describe('when author username link is hovered', () => {
- it('toggles hover specific CSS classes on author name link', (done) => {
+ it('toggles hover specific CSS classes on author name link', async () => {
createComponent({ author });
const authorUsernameLink = wrapper.find({ ref: 'authorUsernameLink' });
@@ -271,19 +271,15 @@ describe('NoteHeader component', () => {
authorUsernameLink.trigger('mouseenter');
- nextTick(() => {
- expect(authorNameLink.classes()).toContain('hover');
- expect(authorNameLink.classes()).toContain('text-underline');
+ await nextTick();
+ expect(authorNameLink.classes()).toContain('hover');
+ expect(authorNameLink.classes()).toContain('text-underline');
- authorUsernameLink.trigger('mouseleave');
+ authorUsernameLink.trigger('mouseleave');
- nextTick(() => {
- expect(authorNameLink.classes()).not.toContain('hover');
- expect(authorNameLink.classes()).not.toContain('text-underline');
-
- done();
- });
- });
+ await nextTick();
+ expect(authorNameLink.classes()).not.toContain('hover');
+ expect(authorNameLink.classes()).not.toContain('text-underline');
});
});
@@ -296,5 +292,13 @@ describe('NoteHeader component', () => {
createComponent({ isConfidential: status });
expect(findConfidentialIndicator().exists()).toBe(status);
});
+
+ it('shows confidential indicator tooltip for project context', () => {
+ createComponent({ isConfidential: true, noteableType: 'issue' });
+
+ expect(findConfidentialIndicator().attributes('title')).toBe(
+ 'This comment is confidential and only visible to project members',
+ );
+ });
});
});