Skip to content

Commit a8c2190

Browse files
committed
remove react-router component lifecycle tests
1 parent cb787db commit a8c2190

File tree

2 files changed

+5
-61
lines changed

2 files changed

+5
-61
lines changed

test/browser/features/component-lifecycle-spans.feature

-14
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,3 @@ Feature: Component lifecycle spans
88
And a span name equals "[ViewLoadPhase/Unmount]Component"
99
And a span named "[ViewLoadPhase/Update]Component" contains the string array attribute "bugsnag.component.update.props":
1010
| count |
11-
12-
@skip
13-
Scenario: Component lifecycle spans are instrumented with React Router
14-
Given I navigate to the test URL "/docs/react-router"
15-
And I click the element "change-route-nested-component"
16-
And I wait to receive 1 trace
17-
Then a span name equals "[ViewLoad/Component]Component"
18-
And a span name equals "[ViewLoadPhase/Mount]Component"
19-
Then I click the element "update-component"
20-
And I wait to receive 1 span
21-
Then a span name equals "[ViewLoadPhase/Update]ComponentName"
22-
Then I click the element "unmount-component"
23-
And I wait to receive 1 span
24-
Then a span name equals "[ViewLoadPhase/Unmount]ComponentName"

test/browser/features/fixtures/packages/react-router/src/index.jsx

+5-47
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect, useState } from 'react'
1+
import React, { useEffect } from 'react'
22
import ReactDOM from 'react-dom/client'
33
import {
44
createBrowserRouter,
@@ -21,9 +21,6 @@ function Root() {
2121
<Link id="change-route" to="/contacts/1">
2222
Contact 1
2323
</Link>
24-
<Link id="change-route-nested-component" to="/nested-component">
25-
Nested Component
26-
</Link>
2724
<Outlet />
2825
</>
2926
)
@@ -37,56 +34,17 @@ function Contact() {
3734
return <div id="contact">Contact</div>
3835
}
3936

40-
function Component(count) {
41-
return (
42-
<>
43-
<div>
44-
<p>I am a wrapped component!</p>
45-
</div>
46-
<div>{count}</div>
47-
</>
48-
)
49-
}
50-
51-
// const WrappedComponent = withInstrumentedComponent(Component)
52-
53-
function NestedComponent() {
54-
const [show, setShow] = useState(true)
55-
const [count, setCount] = useState(0)
56-
57-
return (
58-
<div>
59-
<button id='update-component' onClick={() => setCount(count + 1)}>
60-
Increment
61-
</button>
62-
<button
63-
id='unmount-component'
64-
onClick={() => {
65-
setShow(!show)
66-
}}
67-
>
68-
{show ? 'Unmount Component' : 'Mount Component'}
69-
</button>
70-
{show && <Component count={count} />}
71-
</div>
72-
)
73-
}
74-
7537
const routes = [
7638
{
7739
path: '/',
7840
element: <Root />,
7941
children: [
8042
{
8143
path: 'contacts/:contactId',
82-
element: <Contact />,
83-
},
84-
{
85-
path: 'nested-component',
86-
element: <NestedComponent />,
87-
},
88-
],
89-
},
44+
element: <Contact />
45+
}
46+
]
47+
}
9048
]
9149

9250
const router = createBrowserRouter(routes, { basename })

0 commit comments

Comments
 (0)