{"size": 977, "ext": "js", "max_stars_repo_path": "test/integration/services/data/test-get-claim-last-updated.js", "max_stars_repo_name": "ministryofjustice/help-with-prison-visits-internal", "max_stars_repo_stars_event_min_datetime": "2016-10-09T20:28:28.000Z", "max_stars_repo_stars_event_max_datetime": "2018-01-22T15:03:30.000Z", "max_issues_repo_path": "test/integration/services/data/test-get-claim-last-updated.js", "max_issues_repo_name": "ministryofjustice/apvs-internal-web", "max_issues_repo_issues_event_min_datetime": "2016-11-01T10:51:27.000Z", "max_issues_repo_issues_event_max_datetime": "2021-04-07T07:37:42.000Z", "max_forks_repo_path": "test/integration/services/data/test-get-claim-last-updated.js", "max_forks_repo_name": "ministryofjustice/help-with-prison-visits-internal", "max_forks_repo_forks_event_min_datetime": "2017-01-22T13:33:33.000Z", "max_forks_repo_forks_event_max_datetime": "2021-04-11T06:12:43.000Z"}
{"max_stars_count": 3, "max_issues_count": 85, "max_forks_count": 2, "avg_line_length": 28.7352941176, "max_line_length": 89, "alphanum_fraction": 0.6192425793}
var expect = require('chai').expect
const dateFormatter = require('../../../../app/services/date-formatter')
var { insertTestData, deleteAll } = require('../../../helpers/database-setup-for-tests')

var getClaimLastUpdated = require('../../../../app/services/data/get-claim-last-updated')
var reference = 'V123456'
var date
var claimId

describe('services/data/get-claim-last-updated', function () {
  describe('module', function () {
    before(function () {
      date = dateFormatter.now()
      return insertTestData(reference, date.toDate(), 'TESTING').then(function (ids) {
        claimId = ids.claimId
      })
    })

    it('should return list of claims and total', function () {
      return getClaimLastUpdated(claimId)
        .then(function (result) {
          expect(result.Status).to.equal('TESTING')
        })
        .catch(function (error) {
          throw error
        })
    })

    after(function () {
      return deleteAll(reference)
    })
  })
})
