-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add total attendance column to workshop dashboard for local summer workshops #26828
Merged
Merged
Changes from 16 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
049c0ce
add total attendance column to workshop dashboard
d37db40
add unit tests
18368b9
Merge branch 'staging' into add-attendance-column
b80d3e5
Merge branch 'staging' into add-attendance-column
c2ad7db
WIP UI tests
f292241
Merge branch 'staging' into add-attendance-column
f0aef54
Merge branch 'staging' into add-attendance-column
b2e25fa
Merge branch 'staging' into add-attendance-column
22a822d
Merge branch 'staging' into add-attendance-column
20ead1b
undo changes to soundlibrary
5f843f9
Update package.json
fe97255
Merge branch 'staging' into add-attendance-column
d916f5a
Merge branch 'staging' into add-attendance-column
d58515f
Merge branch 'staging' into add-attendance-column
ff7f283
prettier changes
4a9b63b
add UI tests
78712f7
Merge branch 'staging' into add-attendance-column
598d9e7
remove column that has moved in staging, remove soundlibrary.json fro…
90b5600
fix tests
42f3233
Merge branch 'staging' into add-attendance-column
c21a524
Merge branch 'staging' into add-attendance-column
16e9c14
Merge branch 'staging' into add-attendance-column
e298989
fix factory
4982fd4
fix serializer test
c1840e4
remove breaking change to pd factory
e6ab338
Merge branch 'staging' into add-attendance-column
8e0ed38
Merge branch 'staging' into add-attendance-column
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3724,4 +3724,4 @@ | |
"category_male_voiceover/you_win_male" | ||
] | ||
} | ||
} | ||
} | ||
54 changes: 54 additions & 0 deletions
54
.../unit/code-studio/pd/workshop_dashboard/components/workshop_enrollment_school_infoTest.js
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,54 @@ | ||
import WorkshopEnrollmentSchoolInfo from '@cdo/apps/code-studio/pd/workshop_dashboard/components/workshop_enrollment_school_info'; | ||
import React from 'react'; | ||
import {expect} from 'chai'; | ||
import {shallow} from 'enzyme'; | ||
|
||
describe('Workshop Enrollment School Info', () => { | ||
const fakeRouter = { | ||
createHref() {} | ||
}; | ||
|
||
const context = { | ||
router: fakeRouter | ||
}; | ||
|
||
it('shows Total Attendance column for local summer workshop', () => { | ||
let workshopEnrollmentSchoolInfo = shallow( | ||
<WorkshopEnrollmentSchoolInfo | ||
enrollments={[]} | ||
accountRequiredForAttendance={true} | ||
onDelete={() => {}} | ||
workshopCourse="CS Principles" | ||
workshopSubject="5-day Summer" | ||
numSessions={5} | ||
/>, | ||
{context} | ||
); | ||
|
||
expect( | ||
workshopEnrollmentSchoolInfo | ||
.find('th') | ||
.filterWhere(col => col.text().includes('Total Attendance')) | ||
).to.have.length(1); | ||
}); | ||
|
||
it('does not show Total Attendance column for non-local-summer workshop', () => { | ||
let workshopEnrollmentSchoolInfo = shallow( | ||
<WorkshopEnrollmentSchoolInfo | ||
enrollments={[]} | ||
accountRequiredForAttendance={true} | ||
onDelete={() => {}} | ||
workshopCourse="CS Discoveries" | ||
workshopSubject="1-day Academic Year, Units 1 and 2" | ||
numSessions={5} | ||
/>, | ||
{context} | ||
); | ||
|
||
expect( | ||
workshopEnrollmentSchoolInfo | ||
.find('th') | ||
.filterWhere(col => col.text().includes('Total Attendance')) | ||
).to.have.length(0); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 I dig it. Thanks for adding additional coverage here! |
||
}); | ||
}); |
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
23 changes: 23 additions & 0 deletions
23
dashboard/test/serializers/api/v1/pd/workshop_enrollment_serializer_test.rb
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,23 @@ | ||
require 'test_helper' | ||
|
||
class Api::V1::Pd::WorkshopEnrollmentSerializerTest < ::ActionController::TestCase | ||
test 'serialized workshop enrollment has expected attributes' do | ||
enrollment = create :pd_enrollment | ||
expected_attributes = [ | ||
:id, :first_name, :last_name, :email, :district_name, :school, :role, | ||
:grades_teaching, :user_id, :attended, :pre_workshop_survey, :attendances | ||
] | ||
|
||
serialized = ::Api::V1::Pd::WorkshopEnrollmentSerializer.new(enrollment).attributes | ||
assert_equal expected_attributes, serialized.keys | ||
end | ||
|
||
test 'attendances' do | ||
workshop = create :pd_workshop, num_sessions: 5 | ||
enrollment = create :pd_enrollment, workshop: workshop | ||
create :pd_attendance, session: workshop.sessions.first, enrollment: enrollment | ||
|
||
serialized = ::Api::V1::Pd::WorkshopEnrollmentSerializer.new(workshop.enrollments.first).attributes | ||
assert_equal enrollment.attendances.count, serialized[:attendances] | ||
end | ||
end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be nice to get
soundLibrary.json
entirely out of this PR, but understandable if that's tricky at this point.