Skip to content

Commit

Permalink
Merge pull request #778 from SlateFoundation/develop
Browse files Browse the repository at this point in the history
Release: v3.9.1
  • Loading branch information
themightychris authored Feb 8, 2023
2 parents 29fff14 + 3ddc64b commit c2038e0
Showing 1 changed file with 28 additions and 12 deletions.
40 changes: 28 additions & 12 deletions cypress/integration/cbl/progress/overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe('CBL / Progress / Overrides', () => {
// set up XHR monitors
cy.intercept('GET', '/cbl/dashboards/demonstrations/teacher/bootstrap').as('getBootstrapData');
cy.intercept('/cbl/student-competencies?(\\?*)').as('getStudentCompetencies');
cy.intercept('/cbl/competencies?(\\?*)').as('getCompetencies');
cy.intercept('/cbl/demonstration-skills?(\\?*)').as('getDemonstrationSkills');
cy.intercept('POST', '/cbl/demonstrations/save?(\\?*)').as('saveDemonstration');

Expand Down Expand Up @@ -196,27 +197,35 @@ describe('CBL / Progress / Overrides', () => {
.find(`.cbl-grid-skill-row[data-skill="${skill}"] .cbl-grid-demos-cell[data-student="${student}"]`)
.click();

// ensure bootstrap data is loaded
cy.wait('@getDemonstrationSkills');
cy.get('@getDemonstrationSkills.all').should('have.length', 1);

// wait for window to transition open
cy.extGet('title[text="Skill History"] ^ slate-window')
.should('not.have.class', 'x-hidden-clip')
.within(($window) => {
cy.extGet('button[text="Submit Evidence"]')
.should('exist')
cy.get('.x-btn-inner:contains("Submit Evidence")')
.should('have.length', 1)
.click();
});

// ensure competency data is loaded
cy.wait('@getCompetencies');
cy.get('@getCompetencies.all').should('have.length', 1);

// wait for window to transition open
cy.extGet('title[text="Submit Evidence"] ^ slate-window')
.should('not.have.class', 'x-hidden-clip')
.within(($window) => {
cy.extGet('slate-cbl-demonstrations-demonstrationform combobox[fieldLabel="Type of Experience"]')
.within(() => {
cy.get('input[name="ExperienceType"]')
.type('Studio');

cy.extGet('slate-cbl-demonstrations-demonstrationform combobox[fieldLabel="Name of Experience"]')
cy.get('input[name="Context"]')
.type('Test');

cy.extGet('slate-cbl-demonstrations-demonstrationform combobox[fieldLabel="Performance Task"]')
.type('Debate');
cy.get('input[name="PerformanceType"]')
.type('Test');

cy.extGet('slate-cbl-ratings-slider', { all: true, component: true })
.should('have.length', 3)
Expand All @@ -226,14 +235,17 @@ describe('CBL / Progress / Overrides', () => {
_selectRating(sliders[0], 9);
});

cy.extGet('slate-cbl-demonstrations-demonstrationform textarea[fieldLabel="Comments"]')
.type('Test rating');

cy.extGet('button[text="Save Evidence"]')
.should('exist')
cy.get('.x-btn-inner:contains("Save Evidence")')
.should('have.length', 1)
.click();
});

// ensure demonstration is saved
cy.wait('@saveDemonstration');

// ensure competency data is loaded
cy.wait('@getDemonstrationSkills');

// close the window
cy.extGet('title[text="Skill History"] ^ slate-window')
.should('not.have.class', 'x-hidden-clip')
Expand Down Expand Up @@ -312,6 +324,10 @@ function overrideSkill(competency, skill, student) {
.find(`.cbl-grid-skill-row[data-skill="${skill}"] .cbl-grid-demos-cell[data-student="${student}"]`)
.click();

// ensure bootstrap data is loaded
cy.wait('@getDemonstrationSkills');
cy.get('@getDemonstrationSkills.all').should('have.length', 1);

// wait for history window to transition open
cy.extGet('title[text="Skill History"] ^ slate-window')
.should('not.have.class', 'x-hidden-clip')
Expand Down

0 comments on commit c2038e0

Please sign in to comment.