summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConstance Okoghenun <constanceokoghenun@gmail.com>2018-09-24 22:19:11 +0100
committerConstance Okoghenun <constanceokoghenun@gmail.com>2018-09-24 22:19:11 +0100
commite7e994adef72c2eb1d9e4004976cc4a7e13eba7a (patch)
treee69de0fcb27a13a205c80a0fccc57542a8a3d32e
parent75ae4348b1339a0505b0094925741c1ed373dd94 (diff)
downloadgitlab-ce-e7e994adef72c2eb1d9e4004976cc4a7e13eba7a.tar.gz
Reverted changes in spec/javascripts/vue_shared/components/user_avatar/user_avatar_link_spec.js
-rw-r--r--spec/javascripts/vue_shared/components/user_avatar/user_avatar_link_spec.js50
1 files changed, 21 insertions, 29 deletions
diff --git a/spec/javascripts/vue_shared/components/user_avatar/user_avatar_link_spec.js b/spec/javascripts/vue_shared/components/user_avatar/user_avatar_link_spec.js
index cb255d51c20..4c5c242cbb3 100644
--- a/spec/javascripts/vue_shared/components/user_avatar/user_avatar_link_spec.js
+++ b/spec/javascripts/vue_shared/components/user_avatar/user_avatar_link_spec.js
@@ -2,8 +2,8 @@ import _ from 'underscore';
import Vue from 'vue';
import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link.vue';
-describe('User Avatar Link Component', function() {
- beforeEach(function() {
+describe('User Avatar Link Component', function () {
+ beforeEach(function () {
this.propsData = {
linkHref: 'myavatarurl.com',
imgSize: 99,
@@ -24,40 +24,40 @@ describe('User Avatar Link Component', function() {
[this.userAvatarImage] = this.userAvatarLink.$children;
});
- it('should return a defined Vue component', function() {
+ it('should return a defined Vue component', function () {
expect(this.userAvatarLink).toBeDefined();
});
- it('should have user-avatar-image registered as child component', function() {
+ it('should have user-avatar-image registered as child component', function () {
expect(this.userAvatarLink.$options.components.userAvatarImage).toBeDefined();
});
- it('user-avatar-link should have user-avatar-image as child component', function() {
+ it('user-avatar-link should have user-avatar-image as child component', function () {
expect(this.userAvatarImage).toBeDefined();
});
- it('should render <a> as a child element', function() {
+ it('should render <a> as a child element', function () {
expect(this.userAvatarLink.$el.tagName).toBe('A');
});
- it('should have <img> as a child element', function() {
+ it('should have <img> as a child element', function () {
expect(this.userAvatarLink.$el.querySelector('img')).not.toBeNull();
});
- it('should return neccessary props as defined', function() {
+ it('should return neccessary props as defined', function () {
_.each(this.propsData, (val, key) => {
expect(this.userAvatarLink[key]).toBeDefined();
});
});
- describe('no username', function() {
- beforeEach(function(done) {
+ describe('no username', function () {
+ beforeEach(function (done) {
this.userAvatarLink.username = '';
Vue.nextTick(done);
});
- it('should only render image tag in link', function() {
+ it('should only render image tag in link', function () {
const childElements = this.userAvatarLink.$el.childNodes;
expect(childElements[0].tagName).toBe('IMG');
@@ -65,34 +65,26 @@ describe('User Avatar Link Component', function() {
expect(childElements[1].tagName).toBeUndefined();
});
- it('should render avatar image tooltip', function() {
- expect(this.userAvatarLink.$el.querySelector('img').dataset.originalTitle).toEqual(
- this.propsData.tooltipText,
- );
+ it('should render avatar image tooltip', function () {
+ expect(this.userAvatarLink.$el.querySelector('img').dataset.originalTitle).toEqual(this.propsData.tooltipText);
});
});
- describe('username', function() {
- it('should not render avatar image tooltip', function() {
+ describe('username', function () {
+ it('should not render avatar image tooltip', function () {
expect(this.userAvatarLink.$el.querySelector('img').dataset.originalTitle).toEqual('');
});
- it('should render username prop in <span>', function() {
- expect(this.userAvatarLink.$el.querySelector('span').innerText.trim()).toEqual(
- this.propsData.username,
- );
+ it('should render username prop in <span>', function () {
+ expect(this.userAvatarLink.$el.querySelector('span').innerText.trim()).toEqual(this.propsData.username);
});
- it('should render text tooltip for <span>', function() {
- expect(this.userAvatarLink.$el.querySelector('span').dataset.originalTitle).toEqual(
- this.propsData.tooltipText,
- );
+ it('should render text tooltip for <span>', function () {
+ expect(this.userAvatarLink.$el.querySelector('span').dataset.originalTitle).toEqual(this.propsData.tooltipText);
});
- it('should render text tooltip placement for <span>', function() {
- expect(
- this.userAvatarLink.$el.querySelector('span').getAttribute('tooltip-placement'),
- ).toEqual(this.propsData.tooltipPlacement);
+ it('should render text tooltip placement for <span>', function () {
+ expect(this.userAvatarLink.$el.querySelector('span').getAttribute('tooltip-placement')).toEqual(this.propsData.tooltipPlacement);
});
});
});