Skip to content

Commit ca1d3ec

Browse files
committed
fix tests
1 parent ef2139c commit ca1d3ec

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

packages/react/test/profiler.test.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { render } from '@testing-library/react';
33
import { renderHook } from '@testing-library/react-hooks';
44
import * as React from 'react';
55

6+
import { REACT_MOUNT_OP, REACT_RENDER_OP, REACT_UPDATE_OP } from '../src/constants';
67
import { UNKNOWN_COMPONENT, useProfiler, withProfiler } from '../src/profiler';
78

89
const mockStartChild = jest.fn((spanArgs: SpanContext) => ({ ...spanArgs }));
@@ -76,7 +77,7 @@ describe('withProfiler', () => {
7677
expect(mockStartChild).toHaveBeenCalledTimes(1);
7778
expect(mockStartChild).toHaveBeenLastCalledWith({
7879
description: `<${UNKNOWN_COMPONENT}>`,
79-
op: 'react.mount',
80+
op: REACT_MOUNT_OP,
8081
});
8182
});
8283
});
@@ -93,7 +94,7 @@ describe('withProfiler', () => {
9394
expect(mockStartChild).toHaveBeenLastCalledWith({
9495
description: `<${UNKNOWN_COMPONENT}>`,
9596
endTimestamp: expect.any(Number),
96-
op: 'react.render',
97+
op: REACT_RENDER_OP,
9798
startTimestamp: undefined,
9899
});
99100
});
@@ -122,7 +123,7 @@ describe('withProfiler', () => {
122123
data: { changedProps: ['num'] },
123124
description: `<${UNKNOWN_COMPONENT}>`,
124125
endTimestamp: expect.any(Number),
125-
op: 'react.update',
126+
op: REACT_UPDATE_OP,
126127
startTimestamp: expect.any(Number),
127128
});
128129

@@ -133,7 +134,7 @@ describe('withProfiler', () => {
133134
data: { changedProps: ['num'] },
134135
description: `<${UNKNOWN_COMPONENT}>`,
135136
endTimestamp: expect.any(Number),
136-
op: 'react.update',
137+
op: REACT_UPDATE_OP,
137138
startTimestamp: expect.any(Number),
138139
});
139140

@@ -169,7 +170,7 @@ describe('useProfiler()', () => {
169170
expect(mockStartChild).toHaveBeenCalledTimes(1);
170171
expect(mockStartChild).toHaveBeenLastCalledWith({
171172
description: '<Example>',
172-
op: 'react.mount',
173+
op: REACT_MOUNT_OP,
173174
});
174175
});
175176
});
@@ -191,7 +192,7 @@ describe('useProfiler()', () => {
191192
expect(mockStartChild).toHaveBeenLastCalledWith(
192193
expect.objectContaining({
193194
description: '<Example>',
194-
op: 'react.render',
195+
op: REACT_RENDER_OP,
195196
}),
196197
);
197198
});

0 commit comments

Comments
 (0)