-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1323 from bcgov/feature/EDX-1504
EDX-1504 - Adds AT for uploaded data summary
- Loading branch information
Showing
5 changed files
with
203 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
tests-e2e/cypress/e2e/sdc-collection/dataUploadSummary.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters