@@ -10,7 +10,7 @@ import PersonIcon from '../internal/svg-icons/Person';
10
10
describe ( '<Avatar />' , ( ) => {
11
11
const { render } = createRenderer ( ) ;
12
12
13
- describeConformance ( < Avatar /> , ( ) => ( {
13
+ describeConformance ( < Avatar alt = "dummy image" src = "/dummy-image.jpg" /> , ( ) => ( {
14
14
classes,
15
15
inheritComponent : 'div' ,
16
16
render,
@@ -21,6 +21,10 @@ describe('<Avatar />', () => {
21
21
testDeepOverrides : { slotName : 'fallback' , slotClassName : classes . fallback } ,
22
22
testVariantProps : { variant : 'solid' } ,
23
23
testCustomVariant : true ,
24
+ slots : {
25
+ root : { expectedClassName : classes . root } ,
26
+ img : { expectedClassName : classes . img } ,
27
+ } ,
24
28
skip : [ 'classesRoot' , 'componentsProp' ] ,
25
29
} ) ) ;
26
30
@@ -96,9 +100,7 @@ describe('<Avatar />', () => {
96
100
97
101
it ( 'should be able to add more props to the image' , ( ) => {
98
102
const onError = spy ( ) ;
99
- const { container } = render (
100
- < Avatar src = "/fake.png" slotProps = { { img : { onError } } } /> ,
101
- ) ;
103
+ const { container } = render ( < Avatar src = "/fake.png" slotProps = { { img : { onError } } } /> ) ;
102
104
const img = container . querySelector ( 'img' ) ;
103
105
fireEvent . error ( img ) ;
104
106
expect ( onError . callCount ) . to . equal ( 1 ) ;
@@ -116,9 +118,7 @@ describe('<Avatar />', () => {
116
118
117
119
it ( 'should be able to add more props to the image' , ( ) => {
118
120
const onError = spy ( ) ;
119
- const { container } = render (
120
- < Avatar src = "/fake.png" slotProps = { { img : { onError } } } /> ,
121
- ) ;
121
+ const { container } = render ( < Avatar src = "/fake.png" slotProps = { { img : { onError } } } /> ) ;
122
122
const img = container . querySelector ( 'img' ) ;
123
123
fireEvent . error ( img ) ;
124
124
expect ( onError . callCount ) . to . equal ( 1 ) ;
0 commit comments