Skip to content

Commit 5937b9f

Browse files
committed
Update test to remove concept of partial record that is going away
1 parent bfc3f17 commit 5937b9f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/Resource.spec.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,14 +274,16 @@ describe('Resource', () => {
274274

275275
describe('update', () => {
276276
it('can update a record', () => {
277-
const partialRecord = { id: '1', attributes: { key: 'value' } };
277+
const id = '1';
278+
const attributes = { key: 'value' };
279+
const relationships = { key: 'value' };
278280
const responseBody = { data: record };
279281
api.patch.mockResolvedValue({ data: responseBody });
280282

281-
const result = resource.update(partialRecord);
283+
const result = resource.update({ id, attributes, relationships });
282284

283285
expect(api.patch).toHaveBeenCalledWith('widgets/1', {
284-
data: { ...partialRecord, type: 'widgets' },
286+
data: { id, type: 'widgets', attributes, relationships },
285287
});
286288
return expect(result).resolves.toEqual(responseBody);
287289
});

0 commit comments

Comments
 (0)