From a5aa4f386bf8c6f7d305dd02b51efc6b653856f3 Mon Sep 17 00:00:00 2001 From: mightycox Date: Tue, 27 Aug 2024 23:10:42 -0700 Subject: [PATCH] at fix --- .../completeCollection.cy.ts | 13 +++-- .../services/sdc-collection-api-service.ts | 50 +++++++++++-------- 2 files changed, 39 insertions(+), 24 deletions(-) diff --git a/tests-e2e/cypress/e2e/sdc-district-collection/completeCollection.cy.ts b/tests-e2e/cypress/e2e/sdc-district-collection/completeCollection.cy.ts index 66e8ab97..f988aefe 100644 --- a/tests-e2e/cypress/e2e/sdc-district-collection/completeCollection.cy.ts +++ b/tests-e2e/cypress/e2e/sdc-district-collection/completeCollection.cy.ts @@ -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'] }); }); @@ -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(); @@ -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.'); }); }); -}); \ No newline at end of file +}); diff --git a/tests-e2e/cypress/services/sdc-collection-api-service.ts b/tests-e2e/cypress/services/sdc-collection-api-service.ts index 7050854a..1ccc6e3c 100644 --- a/tests-e2e/cypress/services/sdc-collection-api-service.ts +++ b/tests-e2e/cypress/services/sdc-collection-api-service.ts @@ -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; @@ -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'; @@ -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;