@@ -10,42 +10,43 @@ import { type Ref, Root } from './root';
1010describe ( 'Page backtop=undefined' , async ( ) => {
1111 let ref : Ref ;
1212 const ct = await ComponentTester . build ( 'Page' , props => (
13- < Root
14- { ...props }
15- title = "title"
16- ref = { el => {
17- ref = el ;
18- } }
19- >
13+ < Root { ...props } title = "title" ref = { el => ( ref = el ) } >
2014 abc
2115 </ Root >
2216 ) ) ;
2317
2418 test ( 'props' , ( ) => ct . testProps ( ) ) ;
2519
26- test ( 'backtop=undefined ' , ( ) => {
27- expect ( ref ! . root ( ) ) . not . toBeUndefined ( ) ;
28- expect ( ref ! . backTop ( ) ) . not . toBeUndefined ( ) ;
20+ test ( 'ref ' , ( ) => {
21+ expect ( ref ! . root ( ) ) . toBeDefined ( ) ;
22+ expect ( ref ! . backTop ( ) ) . toBeDefined ( ) ;
2923 } ) ;
3024} ) ;
3125
32- describe ( 'Page' , async ( ) => {
26+ describe ( 'Page backtop=false ' , async ( ) => {
3327 let ref : Ref ;
3428 await ComponentTester . build ( 'Page' , props => (
35- < Root
36- backTop = { false }
37- { ...props }
38- title = "title"
39- ref = { el => {
40- ref = el ;
41- } }
42- >
29+ < Root backTop = { false } { ...props } title = "title" ref = { el => ( ref = el ) } >
4330 abc
4431 </ Root >
4532 ) ) ;
4633
47- test ( 'backtop=false ' , async ( ) => {
48- expect ( ref ! . root ( ) ) . not . toBeUndefined ( ) ;
34+ test ( 'ref ' , async ( ) => {
35+ expect ( ref ! . root ( ) ) . toBeDefined ( ) ;
4936 expect ( ref ! . backTop ( ) ) . toBeUndefined ( ) ;
5037 } ) ;
5138} ) ;
39+
40+ describe ( 'Page backtop=custom' , async ( ) => {
41+ let ref : Ref ;
42+ await ComponentTester . build ( 'Page' , props => (
43+ < Root backTop = { { rounded : true } } { ...props } title = "title" ref = { el => ( ref = el ) } >
44+ abc
45+ </ Root >
46+ ) ) ;
47+
48+ test ( 'ref' , async ( ) => {
49+ expect ( ref ! . root ( ) ) . toBeDefined ( ) ;
50+ expect ( ref ! . backTop ( ) ) . toBeDefined ( ) ;
51+ } ) ;
52+ } ) ;
0 commit comments