Skip to content

Commit 4428ec0

Browse files
authored
added tests for delete API (#102)
1 parent 72e9ba4 commit 4428ec0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/managers/opportunity-test.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,17 @@ describe('OpportunityManager', function () {
156156
const deletedOpportunity = await opportunityManager.deleteOpportunity(
157157
queryObject
158158
);
159+
160+
it('should not delete if Opportunity does not exist', function() {
161+
162+
expect(deletedOpportunity).to.be.true; // checks if deletedOpportunity is present
163+
164+
expect(deletedOpportunity._id).to.equal( // checks if deletedOpporutnityId is equal to stubValueId
165+
stubValue._id
166+
);
167+
168+
})
169+
159170
expect(stub.calledOnce).to.be.true;
160171

161172
expect(deletedOpportunity.opportunityTitle).to.equal(

0 commit comments

Comments
 (0)