File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
- <div >< div class =" avatar" :style =" style" >
2
+ <div class =" vue- avatar--wrapper " :class = " customClass " :style =" style" >
3
3
<span v-if =" !this.src" >{{ userInitial }}</span >
4
- </div ></ div >
4
+ </div >
5
5
</template >
6
6
7
7
<script >
@@ -21,6 +21,9 @@ export default {
21
21
color: {
22
22
type: String
23
23
},
24
+ customClass: {
25
+ type: String
26
+ },
24
27
size: {
25
28
type: Number ,
26
29
default: 50
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ describe('Avatar.vue', function () {
36
36
37
37
var initial = vm . $children [ 0 ] . initial ( username )
38
38
expect ( initial ) . to . equal ( 'HF' )
39
- expect ( vm . $el . querySelector ( '.avatar > span' ) . textContent ) . to . contain ( initial )
39
+ expect ( vm . $el . querySelector ( '.vue- avatar--wrapper > span' ) . textContent ) . to . contain ( initial )
40
40
} )
41
41
42
42
it ( 'should render an image with the correct \'src\' when given' , function ( ) {
@@ -51,8 +51,8 @@ describe('Avatar.vue', function () {
51
51
expect ( initial ) . to . equal ( 'HF' )
52
52
53
53
/* eslint-disable no-unused-expressions */
54
- expect ( vm . $el . querySelector ( '.avatar > span' ) ) . to . be . null
55
- var av = vm . $el . querySelector ( '.avatar' )
54
+ expect ( vm . $el . querySelector ( '.vue- avatar--wrapper > span' ) ) . to . be . null
55
+ var av = vm . $el . querySelector ( '.vue- avatar--wrapper ' )
56
56
var background = av . style . background // window.getComputedStyle(av,null).width
57
57
expect ( background ) . to . contain ( 'path/to/img' )
58
58
} )
You can’t perform that action at this time.
0 commit comments