{"size": 1039, "ext": "js", "max_stars_repo_path": "shared/src/persistence/dynamo/docketRecord/updateDocketRecord.test.js", "max_stars_repo_name": "kkoskelin/ef-cms", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "shared/src/persistence/dynamo/docketRecord/updateDocketRecord.test.js", "max_issues_repo_name": "kkoskelin/ef-cms", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "shared/src/persistence/dynamo/docketRecord/updateDocketRecord.test.js", "max_forks_repo_name": "kkoskelin/ef-cms", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.8611111111, "max_line_length": 107, "alphanum_fraction": 0.6756496631}
const {
  applicationContext,
} = require('../../../business/test/createTestApplicationContext');
const { updateDocketRecord } = require('./updateDocketRecord');

const mockDocketRecordId = '9b52c605-edba-41d7-b045-d5f992a499d3';
const mockCaseId = '9b52c506-edba-41d7-b045-d5f992a499d3';

const mockDocketRecord = {
  docketRecordId: mockDocketRecordId,
  documentTitle: 'Title of le Document',
  filedBy: 'The one and only, Guy Fieri',
  status: 'complete',
};

describe('updateDocketRecord', () => {
  it('makes put request with the given docket record data for the matching docket record id', async () => {
    await updateDocketRecord({
      applicationContext,
      caseId: mockCaseId,
      docketRecord: mockDocketRecord,
      docketRecordId: mockDocketRecordId,
    });

    expect(
      applicationContext.getDocumentClient().put.mock.calls[0][0],
    ).toMatchObject({
      Item: {
        pk: `case|${mockCaseId}`,
        sk: `docket-record|${mockDocketRecordId}`,
        ...mockDocketRecord,
      },
    });
  });
});
