@@ -72,7 +72,7 @@ describe('Sentry.trackComponent()', () => {
72
72
73
73
expect ( testInitSpan . end ) . toHaveBeenCalledTimes ( 1 ) ;
74
74
expect ( testUpdateSpan . end ) . toHaveBeenCalledTimes ( 1 ) ;
75
- expect ( testTransaction . spans . length ) . toEqual ( 1 ) ;
75
+ expect ( testTransaction . spans . length ) . toEqual ( 2 ) ;
76
76
} ) ;
77
77
78
78
it ( 'creates an update span, when the component is updated' , async ( ) => {
@@ -90,13 +90,13 @@ describe('Sentry.trackComponent()', () => {
90
90
await act ( ( ) => component . $set ( { options : { trackUpdates : true } } ) ) ;
91
91
92
92
// once for init (unimportant here), once for starting the update span
93
- expect ( testTransaction . startChild ) . toHaveBeenCalledTimes ( 1 ) ;
93
+ expect ( testTransaction . startChild ) . toHaveBeenCalledTimes ( 2 ) ;
94
94
expect ( testTransaction . startChild ) . toHaveBeenLastCalledWith ( {
95
95
description : '<Dummy$>' ,
96
- op : 'ui.svelte.init ' ,
96
+ op : 'ui.svelte.update ' ,
97
97
origin : 'auto.ui.svelte' ,
98
98
} ) ;
99
- expect ( testTransaction . spans . length ) . toEqual ( 1 ) ;
99
+ expect ( testTransaction . spans . length ) . toEqual ( 3 ) ;
100
100
} ) ;
101
101
102
102
it ( 'only creates init spans if trackUpdates is deactivated' , ( ) => {
@@ -110,7 +110,7 @@ describe('Sentry.trackComponent()', () => {
110
110
111
111
expect ( testInitSpan . startChild ) . not . toHaveBeenCalled ( ) ;
112
112
113
- expect ( testInitSpan . end ) . toHaveBeenCalledTimes ( 0 ) ;
113
+ expect ( testInitSpan . end ) . toHaveBeenCalledTimes ( 1 ) ;
114
114
expect ( testTransaction . spans . length ) . toEqual ( 1 ) ;
115
115
} ) ;
116
116
@@ -156,7 +156,7 @@ describe('Sentry.trackComponent()', () => {
156
156
157
157
expect ( testInitSpan . end ) . toHaveBeenCalledTimes ( 1 ) ;
158
158
expect ( testUpdateSpan . end ) . toHaveBeenCalledTimes ( 1 ) ;
159
- expect ( testTransaction . spans . length ) . toEqual ( 1 ) ;
159
+ expect ( testTransaction . spans . length ) . toEqual ( 2 ) ;
160
160
} ) ;
161
161
162
162
it ( "doesn't do anything, if there's no ongoing transaction" , async ( ) => {
@@ -192,6 +192,6 @@ describe('Sentry.trackComponent()', () => {
192
192
op : 'ui.svelte.init' ,
193
193
origin : 'auto.ui.svelte' ,
194
194
} ) ;
195
- expect ( testTransaction . spans . length ) . toEqual ( 1 ) ;
195
+ expect ( testTransaction . spans . length ) . toEqual ( 2 ) ;
196
196
} ) ;
197
197
} ) ;
0 commit comments