Skip to content

Commit

Permalink
and new exported function to create case in DaRequested
Browse files Browse the repository at this point in the history
  • Loading branch information
TSeelig committed Aug 12, 2019
1 parent 80188ff commit 35e18b9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
10 changes: 8 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ const createDaCase = (params, proxy) => {
return _createCase(params, proxy);
};

const createDaCaseInDaRequested = (params, proxy) => {
params.eventId = 'testRequestDa';
return _createCase(params, proxy)
};

function _createCase(params, proxy) {
return _createCaseForUser(params, proxy)
.then(createCaseResponse => {
Expand Down Expand Up @@ -95,5 +100,6 @@ const _setupProxy = proxy => {
module.exports = {
createAosCase,
createDnCase,
createDaCase
};
createDaCase,
createDaCaseInDaRequested
};
15 changes: 14 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,17 @@ describe('index.js', function () {
expect(request.post.callCount).to.equal(2);
});
});
});

it('should create a DARequested case', function () {
const proxy = '';
const params = {
baseUrl: '',
authToken: '',
caseData: fs.readFileSync('test/test.json')
};
return divTestHarness.createDaCaseInDaRequested(params, proxy)
.then(() => {
expect(request.post.callCount).to.equal(2);
});
});
});

0 comments on commit 35e18b9

Please sign in to comment.