Commit 2262fe6d authored by peterhegman's avatar peterhegman

Add test to ensure correct CSS classes are added on hover

Ensure correct CSS classes are added to author name link when author
username is hovered
parent 739f9da8
......@@ -221,4 +221,29 @@ describe('NoteHeader component', () => {
});
});
});
describe('when author username link is hovered', () => {
it('toggles hover specific CSS classes on author name link', done => {
createComponent({ author });
const authorUsernameLink = wrapper.find({ ref: 'authorUsernameLink' });
const authorNameLink = wrapper.find({ ref: 'authorNameLink' });
authorUsernameLink.trigger('mouseenter');
Vue.nextTick(() => {
expect(authorNameLink.classes()).toContain('hover');
expect(authorNameLink.classes()).toContain('text-underline');
authorUsernameLink.trigger('mouseleave');
Vue.nextTick(() => {
expect(authorNameLink.classes()).not.toContain('hover');
expect(authorNameLink.classes()).not.toContain('text-underline');
done();
});
});
});
});
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment