Skip to content
This repository has been archived by the owner on Jan 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #121 from AppliedIS/jeff-tests
Browse files Browse the repository at this point in the history
More unit testing for the validation service and work sites controller.
  • Loading branch information
MrMatt57 committed Nov 9, 2016
2 parents 8a49a72 + 94ae08d commit ed5f22f
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ describe('sectionWorkSitesController', function() {

beforeEach(inject(function ($rootScope, $controller) {
scope = $rootScope.$new();
scope.responses = {
"PrimaryDisability": [
{
"id": 31,
"display": "Intellectual/Developmental Disability (IDD)",
"otherValueKey": null
},
{
"id": 38,
"display": "Other, please specify:",
"otherValueKey": "primaryDisabilityOther"
}
]
}

sectionWorkSitesController = function() {
return $controller('sectionWorkSitesController', {
Expand Down Expand Up @@ -82,12 +96,24 @@ describe('sectionWorkSitesController', function() {
var controller = sectionWorkSitesController();

controller.activeWorksite = {};
controller.activeWorker = { "name": "First Last" };
controller.activeWorker = {
"name": "First Last",
"primaryDisability": 31
};

controller.getDisabilityDisplay(controller.activeWorker);

controller.addAnotherEmployee();
controller.doneAddingEmployees();
expect(controller.activeWorksite.employees.length).toBe(1);

controller.editEmployee(0);
controller.activeWorker.primaryDisability = 38;
controller.activeWorker.primaryDisabilityId = 38;
controller.activeWorker.primaryDisabilityOther = "other";

controller.getDisabilityDisplay(controller.activeWorker);

controller.addEmployee();
expect(controller.activeWorksite.employees.length).toBe(1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ describe('validationService', function() {
"streetAddress": "1600 Pennsylvania Ave.",
"city": "Washington",
"state": "DC",
"zipCode": "20500"
"zipCode": "2050x"
},
"sca": false,
"federalContractWorkPerformed": true,
"numEmployees": 1,
"numEmployees": 2,
"employees": [
{
"name": "Joe Plumber",
"primaryDisability": 31,
"primaryDisability": 35,
"workType": "Work type",
"numJobs": 1,
"avgWeeklyHours": 40,
Expand All @@ -58,7 +58,8 @@ describe('validationService', function() {
"commensurateWageRate": 102.1,
"totalHours": 40,
"workAtOtherSite": false,
"primaryDisabilityId": 31
"primaryDisabilityId": 35,
"primaryDisabilityOther": "other disability"
}
],
"workSiteTypeId": 27
Expand Down Expand Up @@ -103,10 +104,10 @@ describe('validationService', function() {
"applicationType": 1,
"hasPreviousApplication": false,
"hasPreviousCertificate": true,
"certificateNumber": "12-34567-H-890",
"certificateNumber": "12-34567-H-89",
"contactName": "Bob Roberts",
"contactPhone": "123-456-7890",
"contactFax": "987-654-3210",
"contactFax": "987-654-310",
"contactEmail": "email@email.com",
"employer": {
"numSubminimalWageWorkers": {
Expand All @@ -119,12 +120,13 @@ describe('validationService', function() {
"providingFacilitiesDeductionTypeId": [
17,
18,
19
20
],
"providingFacilitiesDeductionTypeOther": "other stuff",
"legalName": "AIS",
"hasTradeName": true,
"tradeName": "Applied Information Sciences",
"legalNameHasChanged": false,
"legalNameHasChanged": true,
"physicalAddress": {
"streetAddress": "2681 Commons Blvd.",
"city": "Beavercreek",
Expand All @@ -139,21 +141,22 @@ describe('validationService', function() {
"streetAddress": "11400 Commerce Park Dr.",
"city": "Reston",
"state": "VA",
"zipCode": "20191",
"zipCode": "2019x",
"county": "Reston"
},
"sendMailToParent": true,
"employerStatusId": 8,
"employerStatusId": 10,
"isEducationalAgency": false,
"fiscalQuarterEndDate": "2005-03-01T05:00:00.000Z",
"scaId": 13,
"scaId": 11,
"scaCount": 1,
"eo13658Id": 16,
"representativePayee": true,
"totalDisabledWorkers": 3,
"takeCreditForCosts": true,
"temporaryAuthority": false,
"pca": false,
"employerStatusOther": ""
"employerStatusOther": "status"
},
"payType": 23,
"hourlyWageInfo": {
Expand All @@ -179,7 +182,7 @@ describe('validationService', function() {
},
"totalNumWorkSites": 3,
"applicationTypeId": 1,
"payTypeId": 21,
"payTypeId": 23,
"establishmentTypeId": [
4,
3
Expand All @@ -189,6 +192,7 @@ describe('validationService', function() {
"jobName": "",
"jobDescription": "",
"prevailingWageMethod": 24,
"prevailingWageMethodId": 24,
"mostRecentPrevailingWageSurvey": {
"prevailingWageDetermined": 11,
"basedOnSurvey": "",
Expand Down

0 comments on commit ed5f22f

Please sign in to comment.