Skip to content

Commit

Permalink
Merge pull request #1876 from bcgov/fix/EDX-2895
Browse files Browse the repository at this point in the history
at fix
  • Loading branch information
mightycox authored Aug 28, 2024
2 parents cf949e2 + a5aa4f3 commit 449293a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ describe('SDC District Collection View', () => {
seedData: 'sdcDistrictCollectionCompleteCollectionSeedData'
}).then(response => {
Cypress.env('sdcDistrictCollectionID', response?.sdcDistrictCollection?.sdcDistrictCollectionID);
Cypress.env('collectionTypeCode', response?.sdcDistrictCollection?.collectionTypeCode);
});
cy.task('setup-districtUser', { districtRoles: ['DISTRICT_SDC', 'SUPERINT', 'SECR_TRES', 'EDX_DISTRICT_ADMIN', 'DIS_SDC_RO', 'EDX_EDIT_DISTRICT'], districtCodes: ['998'] });
});
Expand All @@ -44,7 +45,13 @@ describe('SDC District Collection View', () => {

it('can view sign off tab and sign off', () => {
cy.visit('/open-district-collection-details/' + Cypress.env('sdcDistrictCollectionID'));
cy.get(selectors.studentLevelData.stepSeven).should('exist').should('have.class', 'v-stepper-item--selected');
const isJulyCollection = Cypress.env('collectionTypeCode') === 'JULY';
if(isJulyCollection) {
cy.get(selectors.studentLevelData.stepFour).should('exist').should('have.class', 'v-stepper-item--selected');
} else {
cy.get(selectors.studentLevelData.stepSeven).should('exist').should('have.class', 'v-stepper-item--selected');
}

cy.get(selectors.studentLevelData.signOffTab).should('exist').click();

cy.get(selectors.signOffTab._1701SignOffButton).should('exist').click();
Expand All @@ -69,7 +76,7 @@ describe('SDC District Collection View', () => {
cy.get(selectors.signOffTab.studentDifferencesButton).should('exist').click();
cy.get(selectors.signOffTab.studentsFound).should('exist').contains('Students Found: 0');
cy.get(selectors.signOffTab.resolvedDuplicatesButton).should('exist').click();
cy.get(selectors.signOffTab.enrolledResolvedAlert).should('exist').contains('There are no resolved enrollment duplicates.');
cy.get(selectors.signOffTab.enrolledResolvedAlert).should('exist').contains('There are no resolved enrolment duplicates.');
});
});
});
});
50 changes: 29 additions & 21 deletions tests-e2e/cypress/services/sdc-collection-api-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ export class SdcCollectionApiService {
});

if(districtCollectionOptions?.seedData) {
this.setDistrictSeedData(sdcDistrictCollection, sdcSchoolCollections, districtCollectionOptions.seedData);
this.setDistrictSeedData(sdcDistrictCollection, sdcSchoolCollections, districtCollectionOptions.seedData, activeCollection);
}

const urlSdcDistrictCollection = `${this.config.env.studentDataCollection.base_url}${SDC_DISTRICT_COLLECTION_ENDPOINT}/` + activeCollection.collectionID;
Expand Down Expand Up @@ -1014,7 +1014,7 @@ export class SdcCollectionApiService {
}
}

setDistrictSeedData(sdcDistrictCollection: SdcDistrictCollection, sdcSchoolCollections: SdcSchoolCollection[], seedData: string) {
setDistrictSeedData(sdcDistrictCollection: SdcDistrictCollection, sdcSchoolCollections: SdcSchoolCollection[], seedData: string, collection: Collection) {
switch (seedData) {
case 'sdcDistrictCollectionMonitoringSeedData':
sdcDistrictCollection.sdcDistrictCollectionStatusCode = 'LOADED';
Expand Down Expand Up @@ -1092,26 +1092,34 @@ export class SdcCollectionApiService {
}));
break;
case 'sdcDistrictCollectionCompleteCollectionSeedData':
sdcDistrictCollection.sdcDistrictCollectionStatusCode = 'P_DUP_VRFD';
sdcDistrictCollection.collectionTypeCode = collection.collectionTypeCode;
if(collection.collectionTypeCode === 'JULY') {
sdcDistrictCollection.sdcDistrictCollectionStatusCode = 'SUBMITTED';
} else {
sdcDistrictCollection.sdcDistrictCollectionStatusCode = 'P_DUP_VRFD';
}

sdcSchoolCollections.forEach(x => x.students.map((student) => {
student.enrolledGradeCode = '09';
student.localID = '67890';
student.enrolledProgramCodes = '082917';
student.studentPen = '101932770';
student.nativeAncestryInd = 'Y';
student.bandCode = '0547';
student.numberOfCourses = '0700';
student.assignedStudentId = 'ce4bec97-b986-4815-a9f8-6bdfe8578dcf';
student.isGraduated = 'false';
student.specialEducationCategoryCode = 'A';
student.localID = 'student1';
student.penMatchResult = 'DM';
student.fte = 1;
student.isSchoolAged = 'true';
student.isAdult = 'false';
student.legalLastName = 'LEGALLAST';
}));
sdcSchoolCollections.forEach(x => {
x.collectionTypeCode = collection.collectionTypeCode;
x.students.map((student) => {
student.enrolledGradeCode = '09';
student.localID = '67890';
student.enrolledProgramCodes = '082917';
student.studentPen = '101932770';
student.nativeAncestryInd = 'Y';
student.bandCode = '0547';
student.numberOfCourses = '0700';
student.assignedStudentId = 'ce4bec97-b986-4815-a9f8-6bdfe8578dcf';
student.isGraduated = 'false';
student.specialEducationCategoryCode = 'A';
student.localID = 'student1';
student.penMatchResult = 'DM';
student.fte = 1;
student.isSchoolAged = 'true';
student.isAdult = 'false';
student.legalLastName = 'LEGALLAST';
});
});
break;
default:
break;
Expand Down

0 comments on commit 449293a

Please sign in to comment.