Skip to content

Commit

Permalink
Change buttonType -> buttonName
Browse files Browse the repository at this point in the history
  • Loading branch information
spalmurray-codecov committed Jan 21, 2025
1 parent 398493b commit 16a63d2
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ describe('UserDropdown', () => {
expect(eventTracker().track).toHaveBeenCalledWith({
type: 'Button Clicked',
properties: {
buttonType: 'Install GitHub App',
buttonName: 'Install GitHub App',
buttonLocation: 'User dropdown',
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function UserDropdown() {
eventTracker().track({
type: 'Button Clicked',
properties: {
buttonType: 'Install GitHub App',
buttonName: 'Install GitHub App',
buttonLocation: 'User dropdown',
},
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const GithubConfigBanner = () => {
eventTracker().track({
type: 'Button Clicked',
properties: {
buttonType: 'Install GitHub App',
buttonName: 'Install GitHub App',
buttonLocation: 'Configure GitHub app banner',
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('GithubConfigBanner', () => {
expect(eventTracker().track).toHaveBeenCalledWith({
type: 'Button Clicked',
properties: {
buttonType: 'Install GitHub App',
buttonName: 'Install GitHub App',
buttonLocation: 'Configure GitHub app banner',
},
})
Expand Down
8 changes: 4 additions & 4 deletions src/services/events/amplitude/amplitude.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ describe('AmplitudeEventTracker', () => {
tracker.track({
type: 'Button Clicked',
properties: {
buttonType: 'Configure Repo',
buttonName: 'Configure Repo',
},
})

expect(mockAmplitude.track).toHaveBeenCalledWith({
event_type: 'Button Clicked',
event_properties: {
buttonType: 'Configure Repo',
buttonName: 'Configure Repo',
},
})
})
Expand All @@ -133,14 +133,14 @@ describe('AmplitudeEventTracker', () => {
tracker.track({
type: 'Button Clicked',
properties: {
buttonType: 'Configure Repo',
buttonName: 'Configure Repo',
},
})

expect(mockAmplitude.track).toHaveBeenCalledWith({
event_type: 'Button Clicked',
event_properties: {
buttonType: 'Configure Repo',
buttonName: 'Configure Repo',
owner: {
id: 123,
},
Expand Down
4 changes: 2 additions & 2 deletions src/services/events/events.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('EventTracker', () => {
stubbedEventTracker.track({
type: 'Button Clicked',
properties: {
buttonType: 'Install GitHub App',
buttonName: 'Install GitHub App',
buttonLocation: 'test',
},
})
Expand Down Expand Up @@ -70,7 +70,7 @@ describe('EventTracker', () => {
tracker.track({
type: 'Button Clicked',
properties: {
buttonType: 'Install GitHub App',
buttonName: 'Install GitHub App',
buttonLocation: 'test',
},
})
Expand Down
6 changes: 3 additions & 3 deletions src/services/events/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Provider } from 'shared/api/helpers'
//
// Adding event types in this way provides type safety for names and event
// properties.
// E.g., every 'Button Clicked' event must have the buttonType property.
// E.g., every 'Button Clicked' event must have the buttonName property.
//
// Guidelines:
// - Event names should:
Expand All @@ -27,7 +27,7 @@ export type Event =
| {
type: 'Button Clicked'
properties: {
buttonType: ButtonType
buttonName: ButtonName
buttonLocation?: string
}
}
Expand Down Expand Up @@ -85,5 +85,5 @@ export abstract class EventTracker {
// Extend as needed.
//

type ButtonType = 'Install GitHub App' | 'Configure Repo'
type ButtonName = 'Install GitHub App' | 'Configure Repo'
type PageName = 'Owner Page'
2 changes: 1 addition & 1 deletion src/shared/ListRepo/InactiveRepo/InactiveRepo.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe('InactiveRepo', () => {
expect(eventTracker().track).toHaveBeenCalledWith({
type: 'Button Clicked',
properties: {
buttonType: 'Configure Repo',
buttonName: 'Configure Repo',
buttonLocation: 'Repo list',
},
})
Expand Down
2 changes: 1 addition & 1 deletion src/shared/ListRepo/InactiveRepo/InactiveRepo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function InactiveRepo({
eventTracker().track({
type: 'Button Clicked',
properties: {
buttonType: 'Configure Repo',
buttonName: 'Configure Repo',
buttonLocation: 'Repo list',
},
})
Expand Down
2 changes: 1 addition & 1 deletion src/ui/ContextSwitcher/ContextSwitcher.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ describe('ContextSwitcher', () => {
expect(eventTracker().track).toHaveBeenCalledWith({
type: 'Button Clicked',
properties: {
buttonType: 'Install GitHub App',
buttonName: 'Install GitHub App',
buttonLocation: 'Org selector',
},
})
Expand Down
2 changes: 1 addition & 1 deletion src/ui/ContextSwitcher/ContextSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ function ContextSwitcher({
eventTracker().track({
type: 'Button Clicked',
properties: {
buttonType: 'Install GitHub App',
buttonName: 'Install GitHub App',
buttonLocation: 'Org selector',
},
})
Expand Down

0 comments on commit 16a63d2

Please sign in to comment.