mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Test blurRadius (#53037)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53037 Changelog: [Internal] Add `blurRadius` test. Reviewed By: rshest Differential Revision: D79552155 fbshipit-source-id: 710b2f328857a32ecb0db00c36f3eedabe74a249
This commit is contained in:
committed by
Facebook GitHub Bot
parent
d58601b59f
commit
e9fdb23ed2
@@ -107,6 +107,20 @@ describe('<Image>', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('blurRadius', () => {
|
||||
it('provides blur radius for image', () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Image blurRadius={10} />);
|
||||
});
|
||||
|
||||
expect(root.getRenderedOutput({props: ['blurRadius']}).toJSX()).toEqual(
|
||||
<rn-image blurRadius="10" />,
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('ref', () => {
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <react/renderer/components/image/ImageProps.h>
|
||||
#include <react/renderer/components/image/conversions.h>
|
||||
#include <react/renderer/core/propsConversions.h>
|
||||
#include <react/renderer/debug/debugStringConvertibleUtils.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -282,4 +283,16 @@ folly::dynamic ImageProps::getDiffProps(const Props* prevProps) const {
|
||||
|
||||
#endif
|
||||
|
||||
#if RN_DEBUG_STRING_CONVERTIBLE
|
||||
SharedDebugStringConvertibleList ImageProps::getDebugProps() const {
|
||||
const auto& defaultImageProps = ImageProps();
|
||||
|
||||
return ViewProps::getDebugProps() +
|
||||
SharedDebugStringConvertibleList{
|
||||
debugStringConvertibleItem(
|
||||
"blurRadius", blurRadius, defaultImageProps.blurRadius),
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace facebook::react
|
||||
|
||||
@@ -50,6 +50,10 @@ class ImageProps final : public ViewProps {
|
||||
ComponentName getDiffPropsImplementationTarget() const override;
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
#if RN_DEBUG_STRING_CONVERTIBLE
|
||||
SharedDebugStringConvertibleList getDebugProps() const override;
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
|
||||
Reference in New Issue
Block a user