Skip to content

Commit d3ad527

Browse files
committed
Align plugin API error tests
1 parent 680b426 commit d3ad527

3 files changed

Lines changed: 18 additions & 19 deletions

File tree

plugins/alerts/tests.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ describe('Testing Alert API against OpenAPI Specification', function() {
800800
const nonExistentID = "507f1f77bcf86cd799439011"; // Random MongoDB ObjectId
801801

802802
request.get(getRequestURL('/i/alert/delete') + "&alertID=" + nonExistentID)
803-
.expect(200)
803+
.expect(404)
804804
.end(function(err, res) {
805805
if (err) {
806806
return done(err);
@@ -817,7 +817,7 @@ describe('Testing Alert API against OpenAPI Specification', function() {
817817
it('should fail when alertID parameter is missing', function(done) {
818818
// Test the endpoint with no alertID parameter
819819
request.get(getRequestURL('/i/alert/delete'))
820-
.expect(200)
820+
.expect(404)
821821
.end(function(err, res) {
822822
if (err) {
823823
return done(err);
@@ -982,4 +982,4 @@ describe('Testing Alert API against OpenAPI Specification', function() {
982982
})
983983
.catch(done);
984984
});
985-
});
985+
});

plugins/crashes/tests.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3264,7 +3264,7 @@ describe('Testing Crashes', function() {
32643264
return done(err);
32653265
}
32663266
var ob = JSON.parse(res.text);
3267-
ob.should.have.property('result', 'Please provide args parameter');
3267+
ob.should.have.property('result', 'Error: args not found');
32683268
done();
32693269
});
32703270
});
@@ -3300,7 +3300,7 @@ describe('Testing Crashes', function() {
33003300
return done(err);
33013301
}
33023302
var ob = JSON.parse(res.text);
3303-
ob.should.have.property('result', 'Please provide args parameter');
3303+
ob.should.have.property('result', 'Error: args not found');
33043304
done();
33053305
});
33063306
});
@@ -3429,7 +3429,7 @@ describe('Testing Crashes', function() {
34293429
return done(err);
34303430
}
34313431
var ob = JSON.parse(res.text);
3432-
ob.should.have.property('result', 'Please provide args parameter');
3432+
ob.should.have.property('result', 'Error: args not found');
34333433
done();
34343434
});
34353435
});
@@ -3443,7 +3443,7 @@ describe('Testing Crashes', function() {
34433443
return done(err);
34443444
}
34453445
var ob = JSON.parse(res.text);
3446-
ob.should.have.property('result', 'Please provide args parameter');
3446+
ob.should.have.property('result', 'Error: args not found');
34473447
done();
34483448
});
34493449
});
@@ -3457,7 +3457,7 @@ describe('Testing Crashes', function() {
34573457
return done(err);
34583458
}
34593459
var ob = JSON.parse(res.text);
3460-
ob.should.have.property('result', 'Please provide args parameter');
3460+
ob.should.have.property('result', 'Error: args not found');
34613461
done();
34623462
});
34633463
});
@@ -3471,7 +3471,7 @@ describe('Testing Crashes', function() {
34713471
return done(err);
34723472
}
34733473
var ob = JSON.parse(res.text);
3474-
ob.should.have.property('result', 'Please provide args parameter');
3474+
ob.should.have.property('result', 'Error: args not found');
34753475
done();
34763476
});
34773477
});
@@ -3485,7 +3485,7 @@ describe('Testing Crashes', function() {
34853485
return done(err);
34863486
}
34873487
var ob = JSON.parse(res.text);
3488-
ob.should.have.property('result', 'Please provide args parameter');
3488+
ob.should.have.property('result', 'Error: args not found');
34893489
done();
34903490
});
34913491
});
@@ -3499,7 +3499,7 @@ describe('Testing Crashes', function() {
34993499
return done(err);
35003500
}
35013501
var ob = JSON.parse(res.text);
3502-
ob.should.have.property('result', 'Please provide args parameter');
3502+
ob.should.have.property('result', 'Error: args not found');
35033503
done();
35043504
});
35053505
});
@@ -3513,7 +3513,7 @@ describe('Testing Crashes', function() {
35133513
return done(err);
35143514
}
35153515
var ob = JSON.parse(res.text);
3516-
ob.should.have.property('result', 'Please provide args parameter');
3516+
ob.should.have.property('result', 'Error: args not found');
35173517
done();
35183518
});
35193519
});
@@ -3527,7 +3527,7 @@ describe('Testing Crashes', function() {
35273527
return done(err);
35283528
}
35293529
var ob = JSON.parse(res.text);
3530-
ob.should.have.property('result', 'Please provide args parameter');
3530+
ob.should.have.property('result', 'Error: args not found');
35313531
done();
35323532
});
35333533
});
@@ -3541,7 +3541,7 @@ describe('Testing Crashes', function() {
35413541
return done(err);
35423542
}
35433543
var ob = JSON.parse(res.text);
3544-
ob.should.have.property('result', 'Please provide args parameter');
3544+
ob.should.have.property('result', 'Error: args not found');
35453545
done();
35463546
});
35473547
});
@@ -3555,7 +3555,7 @@ describe('Testing Crashes', function() {
35553555
return done(err);
35563556
}
35573557
var ob = JSON.parse(res.text);
3558-
ob.should.have.property('result', 'Please provide args parameter');
3558+
ob.should.have.property('result', 'Error: args not found');
35593559
done();
35603560
});
35613561
});
@@ -3569,7 +3569,7 @@ describe('Testing Crashes', function() {
35693569
return done(err);
35703570
}
35713571
var ob = JSON.parse(res.text);
3572-
ob.should.have.property('result', 'Please provide args parameter');
3572+
ob.should.have.property('result', 'Error: args not found');
35733573
done();
35743574
});
35753575
});
@@ -3650,7 +3650,7 @@ describe('Testing Crashes', function() {
36503650

36513651
it('should return 400 for invalid /i/crashes path', function(done) {
36523652
request
3653-
.get('/i/crashes/invalid_path?app_id=' + APP_ID + '&api_key=' + API_KEY_ADMIN)
3653+
.get('/i/crashes/invalid_path?args={}&app_id=' + APP_ID + '&api_key=' + API_KEY_ADMIN)
36543654
.expect(400)
36553655
.end(function(err, res) {
36563656
if (err) {

plugins/hooks/tests/crud.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ describe('Testing Hooks', function() {
214214
if (err) {
215215
return resolve();
216216
}
217-
res.body.should.have.property('result', 'Invalid configuration for effects');
217+
res.body.should.have.property('result', 'Invalid effect configuration');
218218
resolve();
219219
});
220220
});
@@ -1119,4 +1119,3 @@ describe('Testing Hooks', function() {
11191119
});
11201120

11211121
});
1122-

0 commit comments

Comments
 (0)