File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
src/components/avatar/__tests__ Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,16 @@ const mockProps = {
19
19
onClick : jest . fn ( ) ,
20
20
} ;
21
21
22
+ const mockPropsWithoutOnClick = {
23
+ size : 'SMALL' ,
24
+ dot : {
25
+ variant : 'WITH_BORDER' ,
26
+ size : 'BIG' ,
27
+ number : 1 ,
28
+ maxNumber : 2 ,
29
+ } ,
30
+ } ;
31
+
22
32
describe ( 'Avatar component' , ( ) => {
23
33
test ( 'Should render Avatar with Initials component' , async ( ) => {
24
34
const { container } = renderProvider ( < Avatar { ...mockProps } initials = { { content : 'HA' } } /> ) ;
@@ -30,6 +40,18 @@ describe('Avatar component', () => {
30
40
expect ( results ) . toHaveNoViolations ( ) ;
31
41
} ) ;
32
42
43
+ test ( 'Should render Avatar with Initials component without onclick' , async ( ) => {
44
+ const { container } = renderProvider (
45
+ < Avatar { ...mockPropsWithoutOnClick } initials = { { content : 'HA' } } />
46
+ ) ;
47
+ const avatar = screen . queryByText ( 'HA' ) ;
48
+ expect ( avatar ) . toBeDefined ( ) ;
49
+
50
+ const results = await axe ( container ) ;
51
+ expect ( container ) . toHTMLValidate ( ) ;
52
+ expect ( results ) . toHaveNoViolations ( ) ;
53
+ } ) ;
54
+
33
55
test ( 'Should render Avatar with Icon component' , async ( ) => {
34
56
const { container } = renderProvider ( < Avatar { ...mockProps } icon = { { icon : 'ARROW_ICON' } } /> ) ;
35
57
const avatar = screen . queryByText ( '1' ) ;
You can’t perform that action at this time.
0 commit comments