diff --git a/src/hooks/useResizeObserver.js b/src/hooks/useResizeObserver.js index 6056805..3d6b978 100644 --- a/src/hooks/useResizeObserver.js +++ b/src/hooks/useResizeObserver.js @@ -8,25 +8,23 @@ export const useResizeObserver = (elementRef) => { height: 0, }); useEffect(() => { - const element = elementRef.current; - const onResize = () => { - if (element._outerRef) { + if (elementRef) { setElementDims({ - width: element._outerRef.clientWidth, - height: element._outerRef.clientHeight, + width: elementRef.clientWidth, + height: elementRef.clientHeight, }); } }; const resizeObserver = new ResizeObserver(onResize); - if (element._outerRef) { - resizeObserver.observe(element._outerRef); + if (elementRef) { + resizeObserver.observe(elementRef); } return () => { - if (element._outerRef) { - resizeObserver.unobserve(element._outerRef); + if (elementRef) { + resizeObserver.unobserve(elementRef); } }; }, [elementRef]); diff --git a/tests/__tests__/Components/Filters/__snapshots__/Search.spec.jsx.snap b/tests/__tests__/Components/Filters/__snapshots__/Search.spec.jsx.snap index 783073f..43021b8 100644 --- a/tests/__tests__/Components/Filters/__snapshots__/Search.spec.jsx.snap +++ b/tests/__tests__/Components/Filters/__snapshots__/Search.spec.jsx.snap @@ -26,6 +26,7 @@ exports[`Search renders without crashing 1`] = ` "tableHeaderWidth": "100%", "selectedReqIndex": null, "reqDetail": null, + "numberOfNewEntries": 0, "showReqDetail": false, "typeFilter": Object { "name": null, diff --git a/tests/__tests__/Components/Import/__snapshots__/ImportHar.spec.jsx.snap b/tests/__tests__/Components/Import/__snapshots__/ImportHar.spec.jsx.snap index f70a622..78d23d7 100644 --- a/tests/__tests__/Components/Import/__snapshots__/ImportHar.spec.jsx.snap +++ b/tests/__tests__/Components/Import/__snapshots__/ImportHar.spec.jsx.snap @@ -26,6 +26,7 @@ exports[`ImportHAR renders without crashing 1`] = ` "tableHeaderWidth": "100%", "selectedReqIndex": null, "reqDetail": null, + "numberOfNewEntries": 0, "showReqDetail": false, "typeFilter": Object { "name": null, diff --git a/tests/__tests__/Components/NetworkTable/__snapshots__/NetworkTableHeader.spec.jsx.snap b/tests/__tests__/Components/NetworkTable/__snapshots__/NetworkTableHeader.spec.jsx.snap index f8c72e8..9a55283 100644 --- a/tests/__tests__/Components/NetworkTable/__snapshots__/NetworkTableHeader.spec.jsx.snap +++ b/tests/__tests__/Components/NetworkTable/__snapshots__/NetworkTableHeader.spec.jsx.snap @@ -26,6 +26,7 @@ exports[`NetworkTableHeader renders without crashing 1`] = ` "tableHeaderWidth": "100%", "selectedReqIndex": null, "reqDetail": null, + "numberOfNewEntries": 0, "showReqDetail": false, "typeFilter": Object { "name": null, diff --git a/tests/__tests__/Components/NetworkTable/__snapshots__/NetworkTableRow.spec.jsx.snap b/tests/__tests__/Components/NetworkTable/__snapshots__/NetworkTableRow.spec.jsx.snap index 256bb7e..4776383 100644 --- a/tests/__tests__/Components/NetworkTable/__snapshots__/NetworkTableRow.spec.jsx.snap +++ b/tests/__tests__/Components/NetworkTable/__snapshots__/NetworkTableRow.spec.jsx.snap @@ -26,6 +26,7 @@ exports[`NetworkTableRow renders without crashing 1`] = ` "tableHeaderWidth": "100%", "selectedReqIndex": null, "reqDetail": null, + "numberOfNewEntries": 0, "showReqDetail": false, "typeFilter": Object { "name": null, diff --git a/tests/__tests__/Components/ReqDetail/__snapshots__/Headers.spec.jsx.snap b/tests/__tests__/Components/ReqDetail/__snapshots__/Headers.spec.jsx.snap index 7ad0cf3..49818fc 100644 --- a/tests/__tests__/Components/ReqDetail/__snapshots__/Headers.spec.jsx.snap +++ b/tests/__tests__/Components/ReqDetail/__snapshots__/Headers.spec.jsx.snap @@ -140,7 +140,7 @@ exports[`Headers renders without crashing 1`] = `
-

@@ -149,8 +149,8 @@ exports[`Headers renders without crashing 1`] = ` https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice -

-

+

@@ -159,8 +159,8 @@ exports[`Headers renders without crashing 1`] = ` GET -

-

+

@@ -169,8 +169,8 @@ exports[`Headers renders without crashing 1`] = ` 200 -

-

+

@@ -179,7 +179,7 @@ exports[`Headers renders without crashing 1`] = ` :80 -

+
diff --git a/tests/__tests__/Components/ReqDetail/__snapshots__/Response.spec.jsx.snap b/tests/__tests__/Components/ReqDetail/__snapshots__/Response.spec.jsx.snap index ec17a81..15d47f3 100644 --- a/tests/__tests__/Components/ReqDetail/__snapshots__/Response.spec.jsx.snap +++ b/tests/__tests__/Components/ReqDetail/__snapshots__/Response.spec.jsx.snap @@ -2,9 +2,14 @@ exports[`Response renders without crashing for content 1`] = `
-
+  
+ +
+ {"foo": "bar"} -
+
`; diff --git a/tests/__tests__/Components/ReqDetail/headers/__snapshots__/General.spec.jsx.snap b/tests/__tests__/Components/ReqDetail/headers/__snapshots__/General.spec.jsx.snap index 4c33c69..bac1972 100644 --- a/tests/__tests__/Components/ReqDetail/headers/__snapshots__/General.spec.jsx.snap +++ b/tests/__tests__/Components/ReqDetail/headers/__snapshots__/General.spec.jsx.snap @@ -2,23 +2,23 @@ exports[`General renders intercept error 1`] = `
-

Request URL: -

-

+

Request Method: -

-

+

@@ -27,51 +27,51 @@ exports[`General renders intercept error 1`] = ` ERR_TIMED_OUT -

-

+

Remote Address: -

+
`; exports[`General renders without crashing 1`] = `
-

Request URL: -

-

+

Request Method: -

-

+

Status Code: -

-

+

Remote Address: -

+
`; diff --git a/tests/__tests__/Containers/__snapshots__/FilterContainer.spec.jsx.snap b/tests/__tests__/Containers/__snapshots__/FilterContainer.spec.jsx.snap index 5a49aca..e570f47 100644 --- a/tests/__tests__/Containers/__snapshots__/FilterContainer.spec.jsx.snap +++ b/tests/__tests__/Containers/__snapshots__/FilterContainer.spec.jsx.snap @@ -26,6 +26,7 @@ exports[`FilterContainer renders without crashing 1`] = ` "tableHeaderWidth": "100%", "selectedReqIndex": null, "reqDetail": null, + "numberOfNewEntries": 0, "showReqDetail": false, "typeFilter": Object { "name": null, diff --git a/tests/__tests__/Containers/__snapshots__/MainContainer.spec.jsx.snap b/tests/__tests__/Containers/__snapshots__/MainContainer.spec.jsx.snap index c4c850d..900667c 100644 --- a/tests/__tests__/Containers/__snapshots__/MainContainer.spec.jsx.snap +++ b/tests/__tests__/Containers/__snapshots__/MainContainer.spec.jsx.snap @@ -26,6 +26,7 @@ exports[`MainContainer renders without crashing 1`] = ` "tableHeaderWidth": "100%", "selectedReqIndex": null, "reqDetail": null, + "numberOfNewEntries": 0, "showReqDetail": false, "typeFilter": Object { "name": null, diff --git a/tests/__tests__/Containers/__snapshots__/NetworkTableContainer.spec.jsx.snap b/tests/__tests__/Containers/__snapshots__/NetworkTableContainer.spec.jsx.snap index fa951a8..b9ec071 100644 --- a/tests/__tests__/Containers/__snapshots__/NetworkTableContainer.spec.jsx.snap +++ b/tests/__tests__/Containers/__snapshots__/NetworkTableContainer.spec.jsx.snap @@ -26,6 +26,7 @@ exports[`NetworkTableContainer renders without crashing 1`] = ` "tableHeaderWidth": "100%", "selectedReqIndex": null, "reqDetail": null, + "numberOfNewEntries": 0, "showReqDetail": false, "typeFilter": Object { "name": null, diff --git a/tests/__tests__/Containers/__snapshots__/ReqDetailContainer.spec.jsx.snap b/tests/__tests__/Containers/__snapshots__/ReqDetailContainer.spec.jsx.snap index 2a0d3c3..042786a 100644 --- a/tests/__tests__/Containers/__snapshots__/ReqDetailContainer.spec.jsx.snap +++ b/tests/__tests__/Containers/__snapshots__/ReqDetailContainer.spec.jsx.snap @@ -26,6 +26,7 @@ exports[`ReqDetailContainer renders without crashing 1`] = ` "tableHeaderWidth": "100%", "selectedReqIndex": null, "reqDetail": null, + "numberOfNewEntries": 0, "showReqDetail": false, "typeFilter": Object { "name": null, diff --git a/tests/__tests__/Containers/__snapshots__/TimelineContainer.spec.jsx.snap b/tests/__tests__/Containers/__snapshots__/TimelineContainer.spec.jsx.snap index 3011e5b..c7dd8be 100644 --- a/tests/__tests__/Containers/__snapshots__/TimelineContainer.spec.jsx.snap +++ b/tests/__tests__/Containers/__snapshots__/TimelineContainer.spec.jsx.snap @@ -26,6 +26,7 @@ exports[`TimelineContainer renders without crashing 1`] = ` "tableHeaderWidth": "100%", "selectedReqIndex": null, "reqDetail": null, + "numberOfNewEntries": 0, "showReqDetail": false, "typeFilter": Object { "name": null, diff --git a/tests/__tests__/__snapshots__/NetworkViewer.spec.jsx.snap b/tests/__tests__/__snapshots__/NetworkViewer.spec.jsx.snap index ca283d4..d7c8e65 100644 --- a/tests/__tests__/__snapshots__/NetworkViewer.spec.jsx.snap +++ b/tests/__tests__/__snapshots__/NetworkViewer.spec.jsx.snap @@ -32,6 +32,7 @@ exports[`renders without crashing 1`] = ` "tableHeaderWidth": "100%", "selectedReqIndex": null, "reqDetail": null, + "numberOfNewEntries": 0, "showReqDetail": false, "typeFilter": Object { "name": null, diff --git a/tests/__tests__/state/__snapshots__/NetworkProvider.spec.jsx.snap b/tests/__tests__/state/__snapshots__/NetworkProvider.spec.jsx.snap index 2985015..cca4d48 100644 --- a/tests/__tests__/state/__snapshots__/NetworkProvider.spec.jsx.snap +++ b/tests/__tests__/state/__snapshots__/NetworkProvider.spec.jsx.snap @@ -26,6 +26,7 @@ exports[`NetworkProvider renders without crashing 1`] = ` "tableHeaderWidth": "100%", "selectedReqIndex": null, "reqDetail": null, + "numberOfNewEntries": 0, "showReqDetail": false, "typeFilter": Object { "name": null, @@ -77,6 +78,7 @@ exports[`NetworkProvider renders without crashing 1`] = ` "tableHeaderWidth": "100%", "selectedReqIndex": null, "reqDetail": null, + "numberOfNewEntries": 0, "showReqDetail": false, "typeFilter": Object { "name": null,