1
- import { listAttr , obj , ref , refSet , list , listAction , listRef } from "../src/main" ;
1
+ import { listAttr , obj , ref , refSet , list , listAction , listRef , listRefSet } from "../src/main" ;
2
2
3
3
describe ( "prop mocking functions" , ( ) => {
4
4
describe ( "list" , ( ) => {
@@ -102,9 +102,10 @@ describe("prop mocking functions", () => {
102
102
it ( "returns ListReferenceValue mock" , ( ) => {
103
103
const prop = listRef ( ) ;
104
104
expect ( prop ) . toMatchObject ( {
105
+ type : "Reference" ,
105
106
filterable : true ,
106
107
id : expect . stringMatching ( / l i s t R e f _ .+ / ) ,
107
- get : expect . any ( jest . fn . constructor )
108
+ get : expect . any ( Function )
108
109
} ) ;
109
110
expect ( jest . isMockFunction ( prop . get ) ) . toBe ( true ) ;
110
111
expect ( prop . get ( obj ( ) ) ) . toMatchObject ( {
@@ -117,6 +118,23 @@ describe("prop mocking functions", () => {
117
118
} ) ;
118
119
119
120
describe ( "listRefSet" , ( ) => {
120
- it . todo ( "returns ListReferenceSetValue mock" ) ;
121
+ it ( "returns ListReferenceSetValue mock" , ( ) => {
122
+ const prop = listRefSet ( ) ;
123
+ expect ( prop ) . toMatchObject ( {
124
+ type : "ReferenceSet" ,
125
+ filterable : true ,
126
+ id : expect . stringMatching ( / l i s t R e f S e t _ .+ / ) ,
127
+ get : expect . any ( Function )
128
+ } ) ;
129
+ expect ( jest . isMockFunction ( prop . get ) ) . toBe ( true ) ;
130
+ expect ( prop . get ( obj ( ) ) ) . toMatchObject ( {
131
+ status : expect . any ( String ) ,
132
+ value : [
133
+ {
134
+ id : expect . stringMatching ( / o b j _ .+ / )
135
+ }
136
+ ]
137
+ } ) ;
138
+ } ) ;
121
139
} ) ;
122
140
} ) ;
0 commit comments