Skip to content

Commit

Permalink
Merge pull request #1323 from bcgov/feature/EDX-1504
Browse files Browse the repository at this point in the history
EDX-1504 - Adds AT for uploaded data summary
  • Loading branch information
SodhiA1 authored Jan 25, 2024
2 parents eaf01c8 + a9f9814 commit 2acd13c
Show file tree
Hide file tree
Showing 5 changed files with 203 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
density="compact"
type="error"
variant="tonal"
data-cy="headcount-error-banner"
>
<strong>{{ studentsInError }} students</strong> reported with errors - these students are <strong>not included in the summary counts</strong>. Eligible FTE count will be generated once all errors have been fixed in the next step.
</v-alert>
Expand All @@ -18,6 +19,7 @@
density="compact"
type="info"
variant="tonal"
data-cy="headcount-info-banner"
>
Eligible FTE counts are available in Step 3.
</v-alert>
Expand Down
3 changes: 1 addition & 2 deletions tests-e2e/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ export default defineConfig({
return null;
},
'setup-collections': async (schoolCollection: SchoolCollection) => {
await new CollectionSetupUtils(config).setUpSchoolCollection(schoolCollection);
return null;
return await new CollectionSetupUtils(config).setUpSchoolCollection(schoolCollection);
},
'setup-schoolUser': async (schoolUserOptions: SchoolUserOptions) => {
return new UserSetupUtils(config).setupSchoolUser(schoolUserOptions);
Expand Down
63 changes: 63 additions & 0 deletions tests-e2e/cypress/e2e/sdc-collection/dataUploadSummary.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import {AppSetupData} from '../../../cypress.config';
import {SchoolCollection} from '../../services/sdc-collection-api-service';


describe('SDC School Collection - testing Upload School Level Data screen\'s summary or data', () => {
context('Uploaded a file that has no errors or warnings', () => {
before(() => {
cy.logout();
cy.task<AppSetupData>('dataLoad').then(res => {
cy.task<SchoolCollection>('setup-collections', {
school: res.school,
loadWithStudentAndValidations: true,
seedData: 'dataUploadSummaryNoErrors'
}).then(response => {
console.log(response);
Cypress.env('schoolCollectionIdNoErrors', response);
});
cy.task<SchoolUserOptions, EdxUserEntity>('setup-schoolUser', {schoolCodes: ['99998']});
});
});
beforeEach(() => {
cy.login();
});
it('there is an info banner and no error banner for students in error', () => {
const id = Cypress.env('schoolCollectionIdNoErrors');
navigateToUploadScreen(id);
cy.get('[data-cy="headcount-info-banner"]').should('exist');
cy.get('[data-cy="headcount-error-banner"]').should('not.exist');
});
});
context('Uploaded a file that has errors', () => {
before(() => {
cy.logout();
cy.task<AppSetupData>('dataLoad').then(res => {
cy.task<SchoolCollection>('setup-collections', {
school: res.school,
loadWithStudentAndValidations: true,
seedData: 'dataUploadSummaryErrors'
}).then(response => {
console.log(response);
Cypress.env('schoolCollectionIdErrors', response);
});
cy.task<SchoolUserOptions, EdxUserEntity>('setup-schoolUser', {schoolCodes: ['99998']});
});
});
beforeEach(() => {
cy.login();
});
it('there is an error banner for students in error', () => {
const id = Cypress.env('schoolCollectionIdErrors');
navigateToUploadScreen(id);
cy.get('[data-cy="headcount-error-banner"]').should('exist');
});
});
});

function navigateToUploadScreen(id: SchoolCollection) {
cy.intercept(Cypress.env('interceptors').headcounts).as('collection_students_pagination');
cy.intercept(Cypress.env('interceptors').headcounts).as('headcounts');
cy.visit('/open-collection-details/' + id);
cy.wait('@collection_students_pagination');
cy.wait('@headcounts');
}
2 changes: 1 addition & 1 deletion tests-e2e/cypress/helpers/collection-set-up-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ export class CollectionSetupUtils {
}

async setUpSchoolCollection(schoolCollection: SchoolCollection) {
await this.sdcCollectionApi.createSchoolCollection(schoolCollection);
return await this.sdcCollectionApi.createSchoolCollection(schoolCollection);
}
}
136 changes: 136 additions & 0 deletions tests-e2e/cypress/services/sdc-collection-api-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,142 @@ export class SdcCollectionApiService {
]
};
}
else if (schoolCollection.seedData === 'dataUploadSummaryErrors') {
sdcSchoolCollectionPayload = {
'createUser': 'EDXAT',
'updateUser': null,
'createDate': null,
'updateDate': null,
'sdcSchoolCollectionID': null,
'collectionID': activeCollection.collectionID,
'schoolID': schoolCollection?.school.schoolId,
'districtID': schoolCollection?.school.districtId,
'uploadDate': '20230822',
'uploadFileName': 'EDX-AT-FILE.std',
'sdcSchoolCollectionStatusCode': 'NEW',
'collectionTypeCode': 'SEPTEMBER',
'collectionOpenDate': curDate,
'collectionCloseDate': curCloseDate,
'students': [
{
'createUser': 'EDXAT',
'localID': '12345',
'studentPen': '101932770',
'legalFirstName': 'LEGALFIRST',
'legalMiddleNames': null,
'legalLastName': 'LEGALLAST',
'usualFirstName': 'USUALFIRST',
'usualMiddleNames': 'USUALMIDDLE',
'usualLastName': 'USUALLAST',
'dob': '20050630',
'gender': 'M',
'specialEducationCategoryCode': 'A',
'schoolFundingCode': '20',
'nativeAncestryInd': 'N',
'homeLanguageSpokenCode': '943',
'otherCourses': '0',
'supportBlocks': null,
'enrolledGradeCode': '09',
'careerProgramCode': null,
'numberOfCourses': '0700',
'bandCode': '0684',
'enrolledProgramCodes': '082917',
'sdcSchoolCollectionStudentStatusCode': 'ERROR',
'isAdult': 'false',
'isSchoolAged': 'true',
'fte': 1,
'postalCode': 'V8R2Y9',
'fteZeroReasonCode': null,
'frenchProgramNonEligReasonCode': null,
'ellNonEligReasonCode': 'NTENRELL',
'indigenousSupportProgramNonEligReasonCode': 'NTENRINDIG',
'careerProgramNonEligReasonCode': 'NTENRCAREE',
'specialEducationNonEligReasonCode': 'NOSPECIAL',
'isGraduated': 'false',
'assignedStudentId': null,
'assignedPen': null,
'sdcSchoolCollectionStudentValidationIssues': [],
'sdcSchoolCollectionStudentEnrolledPrograms': [
{
'createUser': 'EDXAT',
'updateUser': null,
'createDate': null,
'updateDate': null,
'enrolledProgramCode': '08'
}
]
}
]
};
}
else if (schoolCollection.seedData === 'dataUploadSummaryNoErrors') {
sdcSchoolCollectionPayload = {
'createUser': 'EDXAT',
'updateUser': null,
'createDate': null,
'updateDate': null,
'sdcSchoolCollectionID': null,
'collectionID': activeCollection.collectionID,
'schoolID': schoolCollection?.school.schoolId,
'districtID': schoolCollection?.school.districtId,
'uploadDate': '20230822',
'uploadFileName': 'EDX-AT-FILE.std',
'sdcSchoolCollectionStatusCode': 'NEW',
'collectionTypeCode': 'SEPTEMBER',
'collectionOpenDate': curDate,
'collectionCloseDate': curCloseDate,
'students': [
{
'createUser': 'EDXAT',
'localID': '12345',
'studentPen': '101932770',
'legalFirstName': 'LEGALFIRST',
'legalMiddleNames': null,
'legalLastName': 'LEGALLAST',
'usualFirstName': 'USUALFIRST',
'usualMiddleNames': 'USUALMIDDLE',
'usualLastName': 'USUALLAST',
'dob': '20050630',
'gender': 'M',
'specialEducationCategoryCode': 'A',
'schoolFundingCode': '20',
'nativeAncestryInd': 'N',
'homeLanguageSpokenCode': '943',
'otherCourses': '0',
'supportBlocks': null,
'enrolledGradeCode': '09',
'careerProgramCode': null,
'numberOfCourses': '0700',
'bandCode': '0684',
'enrolledProgramCodes': '082917',
'sdcSchoolCollectionStudentStatusCode': 'VERIFIED',
'isAdult': 'false',
'isSchoolAged': 'true',
'fte': 1,
'postalCode': 'V8R2Y9',
'fteZeroReasonCode': null,
'frenchProgramNonEligReasonCode': null,
'ellNonEligReasonCode': 'NTENRELL',
'indigenousSupportProgramNonEligReasonCode': 'NTENRINDIG',
'careerProgramNonEligReasonCode': 'NTENRCAREE',
'specialEducationNonEligReasonCode': 'NOSPECIAL',
'isGraduated': 'false',
'assignedStudentId': null,
'assignedPen': null,
'sdcSchoolCollectionStudentValidationIssues': [],
'sdcSchoolCollectionStudentEnrolledPrograms': [
{
'createUser': 'EDXAT',
'updateUser': null,
'createDate': null,
'updateDate': null,
'enrolledProgramCode': '08'
}
]
}
]
};
}

} else {
sdcSchoolCollectionPayload = {
Expand Down

0 comments on commit 2acd13c

Please sign in to comment.