@@ -59,20 +59,20 @@ describe('Sentry.trackComponent()', () => {
59
59
render ( DummyComponent , { props : { options : { } } } ) ;
60
60
61
61
expect ( testTransaction . startChild ) . toHaveBeenCalledWith ( {
62
- description : '<Dummy>' ,
62
+ description : '<Dummy$ >' ,
63
63
op : 'ui.svelte.init' ,
64
64
origin : 'auto.ui.svelte' ,
65
65
} ) ;
66
66
67
67
expect ( testInitSpan . startChild ) . toHaveBeenCalledWith ( {
68
- description : '<Dummy>' ,
68
+ description : '<Dummy$ >' ,
69
69
op : 'ui.svelte.update' ,
70
70
origin : 'auto.ui.svelte' ,
71
71
} ) ;
72
72
73
73
expect ( testInitSpan . end ) . toHaveBeenCalledTimes ( 1 ) ;
74
74
expect ( testUpdateSpan . end ) . toHaveBeenCalledTimes ( 1 ) ;
75
- expect ( testTransaction . spans . length ) . toEqual ( 2 ) ;
75
+ expect ( testTransaction . spans . length ) . toEqual ( 1 ) ;
76
76
} ) ;
77
77
78
78
it ( 'creates an update span, when the component is updated' , async ( ) => {
@@ -90,35 +90,35 @@ 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 ( 2 ) ;
93
+ expect ( testTransaction . startChild ) . toHaveBeenCalledTimes ( 1 ) ;
94
94
expect ( testTransaction . startChild ) . toHaveBeenLastCalledWith ( {
95
- description : '<Dummy>' ,
96
- op : 'ui.svelte.update ' ,
95
+ description : '<Dummy$ >' ,
96
+ op : 'ui.svelte.init ' ,
97
97
origin : 'auto.ui.svelte' ,
98
98
} ) ;
99
- expect ( testTransaction . spans . length ) . toEqual ( 3 ) ;
99
+ expect ( testTransaction . spans . length ) . toEqual ( 1 ) ;
100
100
} ) ;
101
101
102
102
it ( 'only creates init spans if trackUpdates is deactivated' , ( ) => {
103
103
render ( DummyComponent , { props : { options : { trackUpdates : false } } } ) ;
104
104
105
105
expect ( testTransaction . startChild ) . toHaveBeenCalledWith ( {
106
- description : '<Dummy>' ,
106
+ description : '<Dummy$ >' ,
107
107
op : 'ui.svelte.init' ,
108
108
origin : 'auto.ui.svelte' ,
109
109
} ) ;
110
110
111
111
expect ( testInitSpan . startChild ) . not . toHaveBeenCalled ( ) ;
112
112
113
- expect ( testInitSpan . end ) . toHaveBeenCalledTimes ( 1 ) ;
113
+ expect ( testInitSpan . end ) . toHaveBeenCalledTimes ( 0 ) ;
114
114
expect ( testTransaction . spans . length ) . toEqual ( 1 ) ;
115
115
} ) ;
116
116
117
117
it ( 'only creates update spans if trackInit is deactivated' , ( ) => {
118
118
render ( DummyComponent , { props : { options : { trackInit : false } } } ) ;
119
119
120
120
expect ( testTransaction . startChild ) . toHaveBeenCalledWith ( {
121
- description : '<Dummy>' ,
121
+ description : '<Dummy$ >' ,
122
122
op : 'ui.svelte.update' ,
123
123
origin : 'auto.ui.svelte' ,
124
124
} ) ;
@@ -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 ( 2 ) ;
159
+ expect ( testTransaction . spans . length ) . toEqual ( 1 ) ;
160
160
} ) ;
161
161
162
162
it ( "doesn't do anything, if there's no ongoing transaction" , async ( ) => {
@@ -188,10 +188,10 @@ describe('Sentry.trackComponent()', () => {
188
188
// but not the second update
189
189
expect ( testTransaction . startChild ) . toHaveBeenCalledTimes ( 1 ) ;
190
190
expect ( testTransaction . startChild ) . toHaveBeenLastCalledWith ( {
191
- description : '<Dummy>' ,
191
+ description : '<Dummy$ >' ,
192
192
op : 'ui.svelte.init' ,
193
193
origin : 'auto.ui.svelte' ,
194
194
} ) ;
195
- expect ( testTransaction . spans . length ) . toEqual ( 2 ) ;
195
+ expect ( testTransaction . spans . length ) . toEqual ( 1 ) ;
196
196
} ) ;
197
197
} ) ;
0 commit comments