diff --git a/.travis.yml b/.travis.yml index d2f3209..2798ace 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1 +1,8 @@ -language: node_js \ No newline at end of file +language: node_js +node_js: +- '8' +cache: yarn +script: +- yarn --version +- yarn check --integrity +- yarn test \ No newline at end of file diff --git a/index.js b/index.js index 9f531e9..83303cf 100644 --- a/index.js +++ b/index.js @@ -13,6 +13,11 @@ const createDnCase = (params, proxy) => { return _createCase(params, proxy); }; +const createDaCase = (params, proxy) => { + params.eventId = 'testAwaitingDecreeAbsolute'; + return _createCase(params, proxy); +}; + function _createCase(params, proxy) { return _createCaseForUser(params, proxy) .then(createCaseResponse => { @@ -89,5 +94,6 @@ const _setupProxy = proxy => { module.exports = { createAosCase, - createDnCase + createDnCase, + createDaCase }; \ No newline at end of file diff --git a/package.json b/package.json index 29fe42f..baa6153 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hmcts/div-test-harness", - "version": "1.0.0", + "version": "1.0.1", "description": "Module used for functional tests to create a case and progress it to a certain state so that other tests can build upon it", "main": "index.js", "scripts": { diff --git a/test/test.js b/test/test.js index 3e89a42..2070e63 100644 --- a/test/test.js +++ b/test/test.js @@ -38,4 +38,17 @@ describe('index.js', function () { expect(request.post.callCount).to.equal(2); }); }); + + it('should create a DA case', function () { + const proxy = ''; + const params = { + baseUrl: '', + authToken: '', + caseData: fs.readFileSync('test/test.json') + }; + return divTestHarness.createDaCase(params, proxy) + .then(() => { + expect(request.post.callCount).to.equal(2); + }); + }); }); \ No newline at end of file