-
-
Notifications
You must be signed in to change notification settings - Fork 353
Fix: V7 - JavaScript V9 - set undefined for updateProd when not set #4740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 55 commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
04b6c06
bump SDKs
lucas-zimerman 0dc4bca
bump SDKs
lucas-zimerman 382fef6
fix build
lucas-zimerman 33af36c
fix tests
lucas-zimerman ad6a76c
fix tests
lucas-zimerman 15342a2
fix lint errors
lucas-zimerman c267f9b
test ts 5.0
lucas-zimerman efea84f
rollback
lucas-zimerman 65a10d5
Merge branch 'v7' into lz/bump/jsv9
lucas-zimerman 028dbf9
fix merge conflict with yarn
lucas-zimerman a57459a
fix new lint issue
lucas-zimerman 5de9867
sync yarn.lock with V7 branch and install new packages
lucas-zimerman ae65521
ensure we are using the JS version from the default node resolution
lucas-zimerman bd64169
update changelog with javascript version bump
lucas-zimerman 39a81c7
fix check type (#4587)
lucas-zimerman 3a4fd4c
add major changes to the SDK
lucas-zimerman d8088ad
fix lint
lucas-zimerman 6f71cda
review check: fix changelog PR number / Fix wrapper incorrect null c…
lucas-zimerman 55c1961
fix incorrect cli version
lucas-zimerman 97853c6
fix lint
lucas-zimerman dc2e123
Merge branch 'v7' into lz/bump/jsv9
lucas-zimerman 9a0b21e
remove shutdowntimeout from android / use newer wizard version
lucas-zimerman 45ee6fa
rollback feedback test change, rollback jest version, fix safe test
lucas-zimerman 816b506
return shutdowntimeout
lucas-zimerman 25bf147
explain tracing sample rate
lucas-zimerman 8584214
fix tracing extension test
lucas-zimerman a26497e
Merge branch 'v7' into lz/bump/jsv9
lucas-zimerman 499e5a3
lint fix
lucas-zimerman 578ad2c
update changelog
lucas-zimerman d7fe6c6
merge v7
lucas-zimerman b08c54f
fix yarn lock merge/ fix ts-jest version no longer exists / fix cor…
lucas-zimerman 19197f3
fix lint on addTimeToInitialDisplay
lucas-zimerman 709697c
fix issue with UIManager test
lucas-zimerman a5ddcda
moved major changes to the correct spot
lucas-zimerman 219a73a
adds test to wrap and use updateProps when not deifned
lucas-zimerman b3ba7a3
lint fix
lucas-zimerman 9f16e0b
hide updateProps and children
lucas-zimerman ce42083
Merge branch 'v7' into lz/jsv9/fix-props
lucas-zimerman 8e03349
Merge branch 'v7' into lz/jsv9/fix-props
lucas-zimerman a38cbcb
TESTS: removed tests that weren't validating relevant code/ remove e…
lucas-zimerman f56d96e
moved sdk.wrap.test to wrap.test.tsx / added tests for react native …
lucas-zimerman 359153b
remove name option and add other defaults for testing
lucas-zimerman 222077c
lets also remove removeUpdateProps
lucas-zimerman a5f021e
Merge branch 'v7' into lz/jsv9/fix-props
lucas-zimerman 37e0c94
Apply suggestions from code review
lucas-zimerman 517161c
fix updateProps as {}, removeUpdateProps flag, clear tests
lucas-zimerman 11dfba7
Merge branch 'v7' into lz/jsv9/fix-props
lucas-zimerman 883a831
Merge branch 'v7' into lz/jsv9/fix-props
lucas-zimerman 415f623
do not affect test
lucas-zimerman 4dc429f
checkpoint
lucas-zimerman 8d9f65b
split mock/real tests
lucas-zimerman 7c8c3d1
split mock/real tests
lucas-zimerman 0eb0901
fix unused usings
lucas-zimerman 0ad5d39
Merge branch 'v7' into lz/jsv9/fix-props
lucas-zimerman 3fc3d9f
Merge branch 'v7' into lz/jsv9/fix-props
lucas-zimerman cb615e1
Apply suggestions from code review
lucas-zimerman cf5c90f
Remove removeUpdateProps
lucas-zimerman 8b93d90
fix lint
lucas-zimerman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
// We can't test wrap with mock and non mocked components, otherwise it will break the RN testing library. | ||
import { render } from '@testing-library/react-native'; | ||
import * as React from 'react'; | ||
import type { ReactNativeWrapperOptions } from 'src/js/options'; | ||
|
||
jest.doMock('../src/js/touchevents', () => { | ||
return { | ||
TouchEventBoundary: ({ children }: { children: React.ReactNode }) => ( | ||
// eslint-disable-next-line react/no-unknown-property | ||
<div testID="touch-boundaryID">{children}</div> | ||
), | ||
} | ||
}); | ||
lucas-zimerman marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
jest.doMock('../src/js/tracing', () => { | ||
return { | ||
ReactNativeProfiler: jest.fn(({ children }: { children: React.ReactNode }) => ( | ||
// eslint-disable-next-line react/no-unknown-property | ||
<div testID="profilerID">{children}</div> | ||
)), | ||
} | ||
}); | ||
|
||
jest.doMock('../src/js/feedback/FeedbackWidgetManager', () => { | ||
return { | ||
FeedbackWidgetProvider: ({ children }: { children: React.ReactNode }) => ( | ||
// eslint-disable-next-line react/no-unknown-property | ||
<div testID="feedback-widgetID">{children}</div> | ||
), | ||
}; | ||
}); | ||
lucas-zimerman marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
|
||
import { wrap } from '../src/js/sdk'; | ||
import { ReactNativeProfiler } from '../src/js/tracing'; | ||
|
||
describe('Sentry.wrap', () => { | ||
|
||
const DummyComponent: React.FC<{ value?: string }> = ({ value }) => <div>{value}</div>; | ||
|
||
it('should not enforce any keys on the wrapped component', () => { | ||
const Mock: React.FC<{ test: 23 }> = () => <></>; | ||
const ActualWrapped = wrap(Mock); | ||
|
||
expect(typeof ActualWrapped.defaultProps).toBe(typeof Mock.defaultProps); | ||
}); | ||
|
||
it('wraps components with Sentry wrappers', () => { | ||
const Wrapped = wrap(DummyComponent); | ||
const renderResult = render(<Wrapped value="wrapped" />); | ||
|
||
expect(renderResult.toJSON()).toMatchInlineSnapshot(` | ||
<div | ||
testID="touch-boundaryID" | ||
> | ||
<div | ||
testID="profilerID" | ||
> | ||
<div | ||
testID="feedback-widgetID" | ||
> | ||
<div> | ||
wrapped | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
`); | ||
}); | ||
|
||
describe('ReactNativeProfiler', () => { | ||
it('uses given options when set', () => { | ||
const options: ReactNativeWrapperOptions = { | ||
profilerProps: { disabled: false, includeRender: true, includeUpdates: true }, | ||
}; | ||
const Wrapped = wrap(DummyComponent, options); | ||
render(<Wrapped value="wrapped" />); | ||
|
||
expect(ReactNativeProfiler).toHaveBeenCalledWith( | ||
expect.objectContaining({ | ||
name: 'Root', | ||
disabled: false, | ||
includeRender: true, | ||
includeUpdates: true | ||
}), | ||
expect.anything(), | ||
); | ||
|
||
expect(ReactNativeProfiler).not.toHaveBeenCalledWith( | ||
expect.objectContaining({ | ||
updateProps: expect.anything(), | ||
}) | ||
); | ||
|
||
expect(ReactNativeProfiler).not.toHaveBeenCalledWith( | ||
expect.objectContaining({ | ||
removeUpdateProps: expect.anything(), | ||
}) | ||
); | ||
}); | ||
|
||
it('ignore updateProps when set', () => { | ||
const { wrap } = jest.requireActual('../src/js/sdk'); | ||
|
||
const Wrapped = wrap(DummyComponent, { updateProps: ['prop'] }); | ||
render(<Wrapped value="wrapped" />); | ||
|
||
expect(ReactNativeProfiler).toHaveBeenCalledWith( | ||
expect.objectContaining({ | ||
name: 'Root', | ||
updateProps: {}, | ||
}), | ||
expect.anything(), | ||
); | ||
}); | ||
}); | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.