Commit b1b596be authored by Clement Ho's avatar Clement Ho

Improve spec to check hidden component

parent 9a2b9d23
...@@ -56,8 +56,12 @@ describe('User Avatar Link Component', function () { ...@@ -56,8 +56,12 @@ describe('User Avatar Link Component', function () {
Vue.nextTick(done); Vue.nextTick(done);
}); });
it('should not render <span> as a child element', function () { it('should only render image tag in link', function () {
expect(this.userAvatarLink.$el.querySelector('span')).toBeNull(); const childElements = this.userAvatarLink.$el.childNodes;
expect(childElements[0].tagName).toBe('IMG');
// Vue will render the hidden component as <!---->
expect(childElements[1].tagName).toBeUndefined();
}); });
it('should render avatar image tooltip', function () { it('should render avatar image tooltip', function () {
......
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