Skip to content

Commit

Permalink
Merge pull request #2 from hmcts/add-ability-to-generate-case-in-Decr…
Browse files Browse the repository at this point in the history
…ee-Absolute-state

Added ability to create DA case
  • Loading branch information
John O'Neill authored Jul 16, 2019
2 parents a459aaa + 17eec8e commit 80f5718
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
9 changes: 8 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
language: node_js
language: node_js
node_js:
- '8'
cache: yarn
script:
- yarn --version
- yarn check --integrity
- yarn test
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down Expand Up @@ -89,5 +94,6 @@ const _setupProxy = proxy => {

module.exports = {
createAosCase,
createDnCase
createDnCase,
createDaCase
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
13 changes: 13 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
});

0 comments on commit 80f5718

Please sign in to comment.