-
Notifications
You must be signed in to change notification settings - Fork 481
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
[Amplitude] Implement section setup complete/cancelled #49375
Conversation
dcd65f6
to
f1ce490
Compare
…, and format userId based on environment
10afc1f
to
46762f1
Compare
@@ -406,4 +408,78 @@ describe('EditSectionForm', () => { | |||
const lessonExtrasField = wrapper.find('LessonExtrasField'); | |||
assert.equal(lessonExtrasField.length, 1); | |||
}); | |||
|
|||
it('sends completed event when save is clicked', () => { | |||
const wrapper = mount( |
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.
Do you need mount
here to ensure the button calls the appropriate function?
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.
I don't actually know what mount
does, I assumed from its usage elsewhere that's just how you instantiate React components. is there a different way that'd be better here?
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.
You can also use shallow
, which renders just the top level component, whereas mount
renders all the child component as well. We generally prefer using shallow
over mount
but there are cases where mount
is necessary. I'm not 100% sure but I think this might be one of those cases
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.
The tests still pass with shallow
, so that seems good!
const {section, courseOfferings, isNewSection} = this.props; | ||
|
||
const courseName = courseOfferings.hasOwnProperty(section.courseOfferingId) | ||
? courseOfferings[section.courseOfferingId].display_name |
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.
Just checking that we want the display_name here (which will change based on locale) and not the id?
(I added this comment below then realized it belonged here -- sorry for the duplicate)
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.
Updated based on slack discussion in e05f83c.
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.
Looks good!
Amplitude instrumentation for
Section Setup Completed
andSection Setup Cancelled
events. Based on #49374.When reviewing, please nitpick as much as you want, since this may be used as example code for other teams for later Amplitude instrumentation.
Links
Testing story
New unit tests, and manual testing locally.