@@ -37,6 +37,7 @@ import {
3737 BrowserTestingModule ,
3838 platformBrowserTesting
3939} from '@angular/platform-browser/testing' ;
40+ import { CrashlyticsService } from '../service' ;
4041
4142use ( sinonChai ) ;
4243use ( chaiAsPromised ) ;
@@ -88,33 +89,31 @@ describe('FirebaseErrorHandler', () => {
8889 } ) ;
8990
9091 it ( 'should log the error to the console' , async ( ) => {
91- await router . navigate ( [ '/static-route' ] ) ;
92-
9392 const testError = new Error ( 'Test error message' ) ;
9493 errorHandler . handleError ( testError ) ;
9594 expect ( getCrashlyticsStub ) . to . have . been . called ;
96- expect ( recordErrorStub ) . to . have . been . calledWith (
97- fakeCrashlytics ,
98- testError ,
99- {
100- 'angular_route_path' : '/static-route'
101- }
102- ) ;
95+ expect ( recordErrorStub ) . to . have . been . calledWith ( fakeCrashlytics , testError ) ;
10396 } ) ;
10497
105- it ( 'should remove dynamic content from route' , async ( ) => {
106- await router . navigate ( [ '/dynamic/my-name/route' ] ) ;
98+ describe ( 'frameworkAttributesProvider' , ( ) => {
99+ it ( 'should report framework attributes' , async ( ) => {
100+ await router . navigate ( [ '/static-route' ] ) ;
107101
108- const testError = new Error ( 'Test error message' ) ;
109- errorHandler . handleError ( testError ) ;
110- expect ( recordErrorStub ) . to . have . been . called ;
111- expect ( recordErrorStub ) . to . have . been . calledWith (
112- fakeCrashlytics ,
113- testError ,
114- {
115- // eslint-disable-next-line camelcase
116- angular_route_path : '/dynamic/:id/route'
117- }
118- ) ;
102+ expect (
103+ ( fakeCrashlytics as CrashlyticsService ) . frameworkAttributesProvider ! ( )
104+ ) . to . deep . equal ( {
105+ 'angular_route_path' : '/static-route'
106+ } ) ;
107+ } ) ;
108+
109+ it ( 'should remove dynamic content from route' , async ( ) => {
110+ await router . navigate ( [ '/dynamic/my-name/route' ] ) ;
111+
112+ expect (
113+ ( fakeCrashlytics as CrashlyticsService ) . frameworkAttributesProvider ! ( )
114+ ) . to . deep . equal ( {
115+ 'angular_route_path' : '/dynamic/:id/route'
116+ } ) ;
117+ } ) ;
119118 } ) ;
120119} ) ;
0 commit comments