Skip to content

Commit

Permalink
chore: Add totalSubSteps property and funnelStepError event (#1354)
Browse files Browse the repository at this point in the history
  • Loading branch information
connorlanigan authored Jul 21, 2023
1 parent afe73ee commit 66fc217
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/internal/analytics/__tests__/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export function mockFunnelMetrics() {
funnelStepStart: jest.fn(),
funnelStepComplete: jest.fn(),
funnelStepNavigation: jest.fn(),
funnelStepError: jest.fn(),
funnelSubStepStart: jest.fn(),
funnelSubStepComplete: jest.fn(),
funnelSubStepError: jest.fn(),
Expand Down
1 change: 1 addition & 0 deletions src/internal/analytics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export let FunnelMetrics: IFunnelMetrics = {
funnelStepStart(): void {},
funnelStepComplete(): void {},
funnelStepNavigation(): void {},
funnelStepError(): void {},
funnelSubStepStart(): void {},
funnelSubStepComplete(): void {},
funnelSubStepError(): void {},
Expand Down
17 changes: 15 additions & 2 deletions src/internal/analytics/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,21 @@ export interface FunnelStepProps extends BaseFunnelProps {
subStepAllSelector: string;
}

export interface FunnelStepStartProps extends FunnelStepProps {
totalSubSteps?: number;
}
export interface FunnelStepCompleteProps extends FunnelStepProps {
totalSubSteps?: number;
}

export interface FunnelStepNavigationProps extends FunnelStepProps {
destinationStepNumber: number;
navigationType: string;
totalSubSteps?: number;
}

export interface FunnelStepErrorProps extends FunnelStepProps {
stepErrorSelector: string;
}

export interface FunnelSubStepProps extends FunnelStepProps {
Expand Down Expand Up @@ -70,9 +82,10 @@ export interface IFunnelMetrics {
funnelComplete: FunnelMethod<BaseFunnelProps>;
funnelSuccessful: FunnelMethod<BaseFunnelProps>;
funnelCancelled: FunnelMethod<BaseFunnelProps>;
funnelStepStart: FunnelMethod<FunnelStepProps>;
funnelStepComplete: FunnelMethod<FunnelStepProps>;
funnelStepStart: FunnelMethod<FunnelStepStartProps>;
funnelStepComplete: FunnelMethod<FunnelStepCompleteProps>;
funnelStepNavigation: FunnelMethod<FunnelStepNavigationProps>;
funnelStepError: FunnelMethod<FunnelStepErrorProps>;
funnelSubStepStart: FunnelMethod<FunnelSubStepProps>;
funnelSubStepComplete: FunnelMethod<FunnelSubStepProps>;
funnelSubStepError: FunnelMethod<OptionalFunnelSubStepErrorProps>;
Expand Down
1 change: 1 addition & 0 deletions src/wizard/__tests__/analytics.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function mockFunnelMetrics() {
funnelStepStart: jest.fn(),
funnelStepComplete: jest.fn(),
funnelStepNavigation: jest.fn(),
funnelStepError: jest.fn(),
funnelSubStepStart: jest.fn(),
funnelSubStepComplete: jest.fn(),
funnelSubStepError: jest.fn(),
Expand Down

0 comments on commit 66fc217

Please sign in to comment.