@@ -30,3 +30,36 @@ it('renders <Copied /> `show` test case', () => {
30
30
expect ( tree ) . toHaveProperty ( 'props.className' , 'w-rjv-copied' ) ;
31
31
expect ( tree ) . toHaveProperty ( 'props.onClick' ) ;
32
32
} ) ;
33
+
34
+ it ( 'renders <Copied /> `show` test case' , ( ) => {
35
+ function TriangleArrow ( props : any ) {
36
+ const { style, ...reset } = props ;
37
+ const defaultStyle : React . CSSProperties = {
38
+ cursor : 'pointer' ,
39
+ height : '1em' ,
40
+ width : '1em' ,
41
+ ...style ,
42
+ } ;
43
+ return (
44
+ < svg viewBox = "0 0 24 24" fill = "var(--w-rjv-arrow-color, currentColor)" style = { defaultStyle } { ...reset } >
45
+ < path d = "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z" > </ path >
46
+ </ svg >
47
+ ) ;
48
+ }
49
+
50
+ const component = renderer . create (
51
+ < Copied text = { { a : 1 } } show render = { ( props ) => < TriangleArrow { ...props } /> } /> ,
52
+ ) ;
53
+ let tree = component . toJSON ( ) ;
54
+ expect ( tree ) . toHaveProperty ( 'type' ) ;
55
+ expect ( tree ) . toHaveProperty ( 'props' ) ;
56
+ expect ( tree ) . toHaveProperty ( 'children' ) ;
57
+ expect ( tree ) . toHaveProperty ( 'type' , 'svg' ) ;
58
+ expect ( tree ) . toHaveProperty ( 'props.viewBox' , '0 0 24 24' ) ;
59
+ expect ( tree ) . toHaveProperty ( 'props.height' , '1em' ) ;
60
+ expect ( tree ) . toHaveProperty ( 'props.width' , '1em' ) ;
61
+ expect ( tree ) . toHaveProperty ( 'props.fill' , 'var(--w-rjv-copied-color, currentColor)' ) ;
62
+ expect ( tree ) . toHaveProperty ( 'props.style' , { cursor : 'pointer' , marginLeft : 5 , height : '1em' , width : '1em' } ) ;
63
+ expect ( tree ) . toHaveProperty ( 'props.className' , 'w-rjv-copied' ) ;
64
+ expect ( tree ) . toHaveProperty ( 'props.onClick' ) ;
65
+ } ) ;
0 commit comments