Skip to content

Commit

Permalink
Merge pull request #1831 from bcgov/fix/at-fixes
Browse files Browse the repository at this point in the history
AT fixes
  • Loading branch information
arcshiftsolutions authored Aug 13, 2024
2 parents 0161d8e + 3ae8635 commit aec6125
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ describe('SDC School Collection View', () => {
cy.get(selectors.studentLevelData.nativeAncestryInd).parent().click();
cy.get(selectors.dropdown.listItem).contains('N').click();

cy.get(selectors.studentLevelData.studentPen).type('101932770');

cy.get(selectors.studentLevelData.saveEditStudentRecord).should('be.enabled');

cy.get(selectors.studentLevelData.saveEditStudentRecord).click();
Expand All @@ -150,6 +152,8 @@ describe('SDC School Collection View', () => {
cy.get(selectors.studentLevelData.nativeAncestryInd).parent().click();
cy.get(selectors.dropdown.listItem).contains('N').click();

cy.get(selectors.studentLevelData.studentPen).type('102866365');

cy.get(selectors.studentLevelData.saveEditStudentRecord).should('be.enabled');

cy.get(selectors.studentLevelData.saveEditStudentRecord).click();
Expand Down Expand Up @@ -184,9 +188,9 @@ describe('SDC School Collection View', () => {
return obj;
}, {});
});

expect(records).to.have.length(6);
const expectedPENs = ['102866365', '101932770', '103169744', ''];
records.pop(); //last item is a null line
expect(records).to.have.length(5);
const expectedPENs = ['102866365', '101932770', '103169744'];
const expectedCourses = ['0700', undefined];
const expectedApprenticeStatus = ['N', undefined, ''];

Expand Down Expand Up @@ -225,9 +229,7 @@ describe('SDC School Collection View', () => {
cy.get(selectors.dataCollectionsLanding.continue).contains('Continue').click();

cy.get(selectors.studentLevelData.collectionSubmission).should('exist');
cy.get(selectors.studentLevelData.stepThree).should('exist').click();
cy.get(selectors.studentLevelData.addStudent).should('be.disabled');
cy.get(selectors.studentLevelData.remove).should('be.disabled');
cy.get(selectors.studentLevelData.stepThree).should('be.disabled');
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,29 +49,35 @@ describe('SDC School Collection View', () => {
cy.get(selectors.studentLevelData.schoolFundingCodes).parent().click();
cy.get(selectors.dropdown.listItem).contains('Newcomer Refugee (16)').click();

cy.get(selectors.studentLevelData.studentPen).type('102866365');

cy.get(selectors.studentLevelData.saveEditStudentRecord).should('be.enabled');

cy.get(selectors.studentLevelData.saveEditStudentRecord).click();
cy.get(selectors.snackbar.mainSnackBar, {timeout:15000}).should('exist').contains('Success! The student details have been updated.');
cy.reload();

// checks tab available in Feb
cy.get(selectors.studentLevelData.collectionTypeYear).should('exist').contains('February 2024 Collection');
cy.get(selectors.stepThreeTabSlider.refugeeButton).should('exist').click();
cy.get(selectors.studentLevelData.studentsFound).should('exist').contains(1);

// checks special filter for refugee funding
cy.get(selectors.refugeeComponent.filterButton).click();
cy.get(selectors.activeFiltersDrawer.drawer).find(selectors.filters.refugeeFundingEligible).click();
cy.get(selectors.filters.cancelBtn).click();

cy.get(selectors.studentLevelData.studentsFound).should('exist').contains(0);

cy.get(selectors.refugeeComponent.filterButton).click();
cy.get(selectors.activeFiltersDrawer.drawer).contains('Clear').click();
cy.get(selectors.activeFiltersDrawer.drawer).find(selectors.filters.refugeeFundingNotEligible).click();
cy.get(selectors.filters.cancelBtn).click();
cy.get(selectors.studentLevelData.studentsFound).should('exist').contains(1);
// Only run if February Collection
cy.get(selectors.studentLevelData.collectionTypeYear).then($el => {
const text = $el.text();
if (text.includes('February')) {
cy.get(selectors.stepThreeTabSlider.refugeeButton).should('exist').click();
cy.get(selectors.studentLevelData.studentsFound).should('exist').contains(1);

// checks special filter for refugee funding
cy.get(selectors.refugeeComponent.filterButton).click();
cy.get(selectors.activeFiltersDrawer.drawer).find(selectors.filters.refugeeFundingEligible).click();
cy.get(selectors.filters.cancelBtn).click();

cy.get(selectors.studentLevelData.studentsFound).should('exist').contains(0);

cy.get(selectors.refugeeComponent.filterButton).click();
cy.get(selectors.activeFiltersDrawer.drawer).contains('Clear').click();
cy.get(selectors.activeFiltersDrawer.drawer).find(selectors.filters.refugeeFundingNotEligible).click();
cy.get(selectors.filters.cancelBtn).click();
cy.get(selectors.studentLevelData.studentsFound).should('exist').contains(1);
}
});
});
});
});
1 change: 1 addition & 0 deletions tests-e2e/cypress/support/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export default {
allowableTab: '#allowableButton',
},
filters: {
applyPenLocalIdNameFilterBtn: '#applyPenLocalIdNameFilter',
clearFilter: '#clear-filter',
studentType: '#studentType',
warnings: '#warnings',
Expand Down

0 comments on commit aec6125

Please sign in to comment.