@@ -9,9 +9,8 @@ import { type Ref } from 'vue'
9
9
10
10
const component = defineComponent ( { template : 'no' } )
11
11
12
- describe . skip ( 'Firestore: Options API' , ( ) => {
13
- const { itemRef, listRef, orderedListRef, collection, doc } =
14
- setupFirestoreRefs ( )
12
+ describe ( 'Firestore: Options API' , ( ) => {
13
+ const { collection, doc } = setupFirestoreRefs ( )
15
14
16
15
it ( 'allows customizing $rtdbBind' , ( ) => {
17
16
const wrapper = mount ( component , {
@@ -50,14 +49,13 @@ describe.skip('Firestore: Options API', () => {
50
49
}
51
50
)
52
51
53
- const items = collection ( )
54
- await items . add ( { } )
52
+ const itemsRef = collection ( )
53
+ await addDoc ( itemsRef , { } )
55
54
56
- await wrapper . vm . $bind ( 'items' , items )
55
+ await wrapper . vm . $bind ( 'items' , itemsRef )
57
56
58
57
expect ( pluginOptions . serialize ) . toHaveBeenCalledTimes ( 1 )
59
58
expect ( pluginOptions . serialize ) . toHaveBeenCalledWith (
60
- // @ts -ignore WTF TS?????
61
59
expect . objectContaining ( { data : expect . any ( Function ) } )
62
60
)
63
61
expect ( wrapper . vm . items ) . toEqual ( [ { foo : 'bar' } ] )
@@ -79,18 +77,16 @@ describe.skip('Firestore: Options API', () => {
79
77
}
80
78
)
81
79
82
- // @ts -ignore
83
- const items : firestore . CollectionReference = db . collection ( )
84
- await items . add ( { } )
80
+ const itemsRef = collection ( )
81
+ await addDoc ( itemsRef , { } )
85
82
86
83
const spy = vi . fn ( ( ) => ( { bar : 'bar' } ) )
87
84
88
- await wrapper . vm . $bind ( 'items' , items , { serialize : spy } )
85
+ await wrapper . vm . $bind ( 'items' , itemsRef , { serialize : spy } )
89
86
90
87
expect ( pluginOptions . serialize ) . not . toHaveBeenCalled ( )
91
88
expect ( spy ) . toHaveBeenCalledTimes ( 1 )
92
89
expect ( spy ) . toHaveBeenCalledWith (
93
- // @ts -ignore WTF TS?????
94
90
expect . objectContaining ( { data : expect . any ( Function ) } )
95
91
)
96
92
expect ( wrapper . vm . items ) . toEqual ( [ { bar : 'bar' } ] )
0 commit comments