summaryrefslogtreecommitdiff
path: root/spec/javascripts/vue_shared
diff options
context:
space:
mode:
authorPaul Slaughter <pslaughter@gitlab.com>2018-08-01 19:43:50 +0000
committerClement Ho <clemmakesapps@gmail.com>2018-08-01 19:43:50 +0000
commitfbfe04401deb7a08da03502282531364aa25d511 (patch)
tree1b8b25c8ca0f7e048aed07de9cdf24a44fc58c36 /spec/javascripts/vue_shared
parentc1fc33d590b3f853ec820fa33ebc114b86af692d (diff)
downloadgitlab-ce-fbfe04401deb7a08da03502282531364aa25d511.tar.gz
Add vanilla JS avatar_helper and update existing avatar helpers
Diffstat (limited to 'spec/javascripts/vue_shared')
-rw-r--r--spec/javascripts/vue_shared/components/identicon_spec.js17
1 files changed, 5 insertions, 12 deletions
diff --git a/spec/javascripts/vue_shared/components/identicon_spec.js b/spec/javascripts/vue_shared/components/identicon_spec.js
index 647680f00f7..0719800c682 100644
--- a/spec/javascripts/vue_shared/components/identicon_spec.js
+++ b/spec/javascripts/vue_shared/components/identicon_spec.js
@@ -25,19 +25,12 @@ describe('IdenticonComponent', () => {
vm.$destroy();
});
- describe('identiconStyles', () => {
- it('should return styles attribute value with `background-color` property', () => {
+ describe('identiconBackgroundClass', () => {
+ it('should return bg class based on entityId', () => {
vm.entityId = 4;
- expect(vm.identiconStyles).toBeDefined();
- expect(vm.identiconStyles.indexOf('background-color: #E0F2F1;') > -1).toBeTruthy();
- });
-
- it('should return styles attribute value with `color` property', () => {
- vm.entityId = 4;
-
- expect(vm.identiconStyles).toBeDefined();
- expect(vm.identiconStyles.indexOf('color: #555;') > -1).toBeTruthy();
+ expect(vm.identiconBackgroundClass).toBeDefined();
+ expect(vm.identiconBackgroundClass).toBe('bg5');
});
});
@@ -58,7 +51,7 @@ describe('IdenticonComponent', () => {
expect(vm.$el.nodeName).toBe('DIV');
expect(vm.$el.classList.contains('identicon')).toBeTruthy();
expect(vm.$el.classList.contains('s40')).toBeTruthy();
- expect(vm.$el.getAttribute('style').indexOf('background-color') > -1).toBeTruthy();
+ expect(vm.$el.classList.contains('bg2')).toBeTruthy();
vm.$destroy();
});