Skip to content

Commit 0af4849

Browse files
committed
removed recordAXSnap switch case
2 parents d59c143 + 216199c commit 0af4849

File tree

4 files changed

+47
-1
lines changed

4 files changed

+47
-1
lines changed

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module.exports = {
2222
transformIgnorePatterns: ['/node_modules/(?!d3|d3-array|internmap|delaunator|robust-predicates)'],
2323
testRegex: '(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$',
2424
moduleFileExtensions: ['ts', 'tsx', 'js'],
25-
setupFilesAfterEnv: ['@testing-library/jest-dom/extend-expect'],
25+
setupFilesAfterEnv: ['@testing-library/jest-dom'],
2626
testEnvironment: 'jsdom',
2727
moduleNameMapper: {
2828
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,13 @@
139139
"eslint-plugin-testing-library": "^6.2.0",
140140
"html-webpack-plugin": "^5.5.4",
141141
"identity-obj-proxy": "^3.0.0",
142+
"jest": "^29.7.0",
142143
"jsdom": "^23.0.1",
143144
"react-dom": "^18.2.0",
144145
"react-router-dom": "^6.21.1",
145146
"sass-loader": "^13.3.2",
146147
"style-loader": "^3.3.3",
148+
"ts-jest": "^29.1.2",
147149
"ts-loader": "^9.5.1",
148150
"typedoc": "^0.25.4",
149151
"typescript": "^5.3.3",
@@ -177,6 +179,7 @@
177179
"html-react-parser": "^5.0.11",
178180
"intro.js": "^7.2.0",
179181
"intro.js-react": "^1.0.0",
182+
"jest-environment-jsdom": "^29.7.0",
180183
"jsondiffpatch": "^0.5.0",
181184
"lodash": "^4.17.21",
182185
"node": "^18.12.1",

src/backend/routers/linkFiber.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@ export default function linkFiber(mode: Status): () => Promise<void> {
100100
},
101101
'*',
102102
);
103+
window.postMessage(
104+
{
105+
action: 'recordAXSnap',
106+
payload: 'recordAXSnap',
107+
},
108+
'*',
109+
);
103110
// --------------INITIATE EVENT LISTENER FOR VISIBILITY CHANGE--------------
104111
/**
105112
* Initiate an event listener for when there is a change to the visibility of the react target application (the browser tab)

src/extension/background.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,39 @@ let activeTab;
1313
const tabsObj = {};
1414
// Will store Chrome web vital metrics and their corresponding values.
1515
const metrics = {};
16+
17+
// function pruning the chrome ax tree and pulling the relevant properties
18+
const pruneAxTree = (axTree) => {
19+
const axArr = [];
20+
for (const node of axTree) {
21+
const {
22+
backendDOMNodeId,
23+
childIds,
24+
ignored,
25+
name,
26+
nodeId,
27+
ignoredReasons,
28+
parentId,
29+
properties,
30+
} = node;
31+
32+
const axNode = {
33+
backendDOMNodeId: backendDOMNodeId,
34+
childIds: childIds,
35+
ignored: ignored,
36+
name: name,
37+
nodeId: nodeId,
38+
ignoredReasons: ignoredReasons,
39+
parentId: parentId,
40+
properties: properties,
41+
};
42+
43+
axArr.push(axNode);
44+
}
45+
46+
return axArr;
47+
};
48+
1649
// This function will create the first instance of the test app's tabs object
1750
// which will hold test app's snapshots, link fiber tree info, chrome tab info, etc.
1851
function createTabObj(title) {
@@ -26,6 +59,9 @@ function createTabObj(title) {
2659
// snapshots is an array of ALL state snapshots for stateful and stateless
2760
// components the Reactime tab working on a specific user application
2861
snapshots: [],
62+
// axSnapshots is an array of the chrome ax tree at different points for state and stateless applications
63+
// functionality to add snapshots is done later
64+
axSnapshots: [],
2965
// index here is the tab index that shows total amount of state changes
3066
index: 0,
3167
//* currLocation points to the current state the user is checking

0 commit comments

Comments
 (0)