Skip to content

Commit

Permalink
Move assignent group loading to ancestor component
Browse files Browse the repository at this point in the history
Test plan:
  - As a teacher:
    - Create multiple grading periods
        - Create assignments with due dates that correspond to them
        - Verify that you can filter assignments by grading periods
    - Create a student and conclude his enrollment
        - Verify in the gradebook that you can toggle
        "Show... Conlcuded enrollments"
    - Create multiple sections
        - Verify that you can filter students by section
    - Create multiple student groups
        - Verify that you can filter by student groups
    - Verify that you can filter assignments by grading period

flag=none

Refs EVAL-1934

Change-Id: Idfcdbf69162bae37da495df573f3aa07dc07030e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/303168
Tested-by: Service Cloud Jenkins <[email protected]>
QA-Review: Derek Williams <[email protected]>
Product-Review: Deborah Kwak <[email protected]>
Reviewed-by: Cameron Ray <[email protected]>
Reviewed-by: Kai Bjorkman <[email protected]>
  • Loading branch information
aaronshaf committed Oct 18, 2022
1 parent 10f73fd commit 93279d0
Show file tree
Hide file tree
Showing 14 changed files with 216 additions and 1,534 deletions.
19 changes: 1 addition & 18 deletions spec/javascripts/jsx/gradebook/GradebookDataSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ QUnit.module('Gradebook#updateStudentHeadersAndReloadData', hooks => {

hooks.beforeEach(() => {
gradebook = createGradebook()
sinon.stub(gradebook.dataLoader, 'reloadStudentDataForEnrollmentFilterChange')
sinon.stub(gradebook.dataLoader, 'reloadStudentData')
})

test('makes a call to update column headers', () => {
Expand All @@ -183,23 +183,6 @@ QUnit.module('Gradebook#updateStudentHeadersAndReloadData', hooks => {
const [columnHeadersToUpdate] = updateColumnHeaders.lastCall.args
deepEqual(columnHeadersToUpdate, ['student'])
})

test('reloads student data', () => {
gradebook.updateStudentHeadersAndReloadData()
strictEqual(gradebook.dataLoader.reloadStudentDataForEnrollmentFilterChange.callCount, 1)
})

test('reloads the student data after the column headers have been updated', () => {
const updateColumnHeaders = sinon.stub(
gradebook.gradebookGrid.gridSupport.columns,
'updateColumnHeaders'
)
gradebook.updateStudentHeadersAndReloadData()
sinon.assert.callOrder(
updateColumnHeaders,
gradebook.dataLoader.reloadStudentDataForEnrollmentFilterChange
)
})
})

QUnit.module('Gradebook#gotCustomColumnDataChunk', {
Expand Down
8 changes: 4 additions & 4 deletions spec/javascripts/jsx/gradebook/GradebookFiltersSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ QUnit.module('Gradebook#updateCurrentSection', {
this.gradebook.postGradesStore = {
setSelectedSection: sinon.stub(),
}
sandbox.stub(this.gradebook.dataLoader, 'reloadStudentDataForSectionFilterChange')
sandbox.stub(this.gradebook.dataLoader, 'reloadStudentData')
sinon.stub(this.gradebook, 'saveSettings').callsFake(() => Promise.resolve())
sandbox.stub(this.gradebook, 'updateSectionFilterVisibility')
},
Expand Down Expand Up @@ -543,7 +543,7 @@ test('has no effect when the section has not changed', function () {

test('reloads student data after saving settings', async function () {
await this.gradebook.updateCurrentSection('2001')
strictEqual(this.gradebook.dataLoader.reloadStudentDataForSectionFilterChange.callCount, 1)
strictEqual(this.gradebook.dataLoader.reloadStudentData.callCount, 1)
})

QUnit.module('Gradebook#isFilteringColumnsByGradingPeriod', {
Expand Down Expand Up @@ -828,7 +828,7 @@ QUnit.module('Gradebook#toggleEnrollmentFilter', {
updateColumnHeaders: sinon.stub(),
},
}
sandbox.stub(this.gradebook.dataLoader, 'reloadStudentDataForEnrollmentFilterChange')
sandbox.stub(this.gradebook.dataLoader, 'reloadStudentData')
sandbox.stub(this.gradebook, 'saveSettings').callsFake(() => Promise.resolve())
},
})
Expand Down Expand Up @@ -861,7 +861,7 @@ test('includes the "student" column id when updating column headers', async func

test('reloads student data after saving settings', async function () {
await this.gradebook.toggleEnrollmentFilter('inactive')
strictEqual(this.gradebook.dataLoader.reloadStudentDataForEnrollmentFilterChange.callCount, 1)
strictEqual(this.gradebook.dataLoader.reloadStudentData.callCount, 1)
})

QUnit.module('Gradebook#updateCurrentModule', {
Expand Down
Loading

0 comments on commit 93279d0

Please sign in to comment.