Skip to content

Commit

Permalink
test: FORMS-1444 update forms routes tests (bcgov#1472)
Browse files Browse the repository at this point in the history
* test: FORMS-1444 form routes

* standardize controller mocks with sendstatus 200
  • Loading branch information
WalterMoar authored Aug 15, 2024
1 parent 5cfc4ea commit 56583b7
Show file tree
Hide file tree
Showing 4 changed files with 727 additions and 53 deletions.
40 changes: 20 additions & 20 deletions app/tests/unit/forms/admin/routes.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,55 +28,55 @@ userAccess.currentUser = jest.fn((_req, _res, next) => {
});

controller.createFormComponentsProactiveHelp = jest.fn((_req, res) => {
res.status(200).json({});
res.sendStatus(200);
});
controller.deleteApiKey = jest.fn((_req, res) => {
res.sendStatus(204);
res.sendStatus(200);
});
controller.getFormUserRoles = jest.fn((_req, res) => {
res.status(200).json({});
controller.getExternalAPIStatusCodes = jest.fn((_req, res) => {
res.sendStatus(200);
});
controller.getExternalAPIs = jest.fn((_req, res) => {
res.status(200).json({});
});
controller.getExternalAPIStatusCodes = jest.fn((_req, res) => {
res.status(200).json({});
res.sendStatus(200);
});
controller.getFCProactiveHelpImageUrl = jest.fn((_req, res) => {
res.status(200).json({});
res.sendStatus(200);
});
controller.getFormUserRoles = jest.fn((_req, res) => {
res.sendStatus(200);
});
controller.getUsers = jest.fn((_req, res) => {
res.status(200).json({});
res.sendStatus(200);
});
controller.listFormComponentsProactiveHelp = jest.fn((_req, res) => {
res.status(200).json({});
res.sendStatus(200);
});
controller.listForms = jest.fn((_req, res) => {
res.status(200).json({});
res.sendStatus(200);
});
controller.readApiDetails = jest.fn((_req, res) => {
res.status(200).json({});
res.sendStatus(200);
});
controller.readForm = jest.fn((_req, res) => {
res.status(200).json({});
res.sendStatus(200);
});
controller.readVersion = jest.fn((_req, res) => {
res.status(200).json({});
res.sendStatus(200);
});
controller.restoreForm = jest.fn((_req, res) => {
res.status(200).json({});
res.sendStatus(200);
});
controller.setFormUserRoles = jest.fn((_req, res) => {
res.status(200).json({});
res.sendStatus(200);
});
controller.updateExternalAPI = jest.fn((_req, res) => {
res.status(200).json({});
res.sendStatus(200);
});
controller.updateFormComponentsProactiveHelp = jest.fn((_req, res) => {
res.status(200).json({});
res.sendStatus(200);
});
userController.read = jest.fn((_req, res) => {
res.status(200).json({});
res.sendStatus(200);
});

const componentId = uuid.v4();
Expand Down
4 changes: 2 additions & 2 deletions app/tests/unit/forms/bcgeoaddress/routes.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ const controller = require('../../../../src/forms/bcgeoaddress/controller');
//

controller.advanceSearchBCGeoAddress = jest.fn((_req, res) => {
res.status(200).json({});
res.sendStatus(200);
});
controller.searchBCGeoAddress = jest.fn((_req, res) => {
res.status(200).json({});
res.sendStatus(200);
});

//
Expand Down
Loading

0 comments on commit 56583b7

Please sign in to comment.