File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -246,17 +246,19 @@ describe('Resource', () => {
246246
247247 describe ( 'create' , ( ) => {
248248 it ( 'can create a record' , ( ) => {
249- const partialRecord = { attributes : { key : 'value' } } ;
249+ const attributes = { key : 'value' } ;
250+ const relationships = { key2 : 'value2' } ;
250251
251252 const responseBody = { data : record } ;
252253 api . post . mockResolvedValue ( { data : responseBody } ) ;
253254
254- const result = resource . create ( partialRecord ) ;
255+ const result = resource . create ( { attributes , relationships } ) ;
255256
256257 expect ( api . post ) . toHaveBeenCalledWith ( 'widgets' , {
257258 data : {
258- ...partialRecord ,
259259 type : 'widgets' ,
260+ attributes,
261+ relationships,
260262 } ,
261263 } ) ;
262264 return expect ( result ) . resolves . toEqual ( responseBody ) ;
You can’t perform that action at this time.
0 commit comments