Skip to content

Commit f8f41da

Browse files
andrewdacenkofacebook-github-bot
authored andcommitted
Test blurRadius
Summary: Changelog: [Internal] Add `blurRadius` test. Reviewed By: rshest Differential Revision: D79552155
1 parent 3e6d5c6 commit f8f41da

3 files changed

Lines changed: 31 additions & 0 deletions

File tree

packages/react-native/Libraries/Image/__tests__/Image-itest.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,20 @@ describe('<Image>', () => {
107107
});
108108
});
109109
});
110+
111+
describe('blurRadius', () => {
112+
it('provides blur radius for image', () => {
113+
const root = Fantom.createRoot();
114+
115+
Fantom.runTask(() => {
116+
root.render(<Image blurRadius={10} />);
117+
});
118+
119+
expect(root.getRenderedOutput({props: ['blurRadius']}).toJSX()).toEqual(
120+
<rn-image blurRadius="10" />,
121+
);
122+
});
123+
});
110124
});
111125

112126
describe('ref', () => {

packages/react-native/ReactCommon/react/renderer/components/image/ImageProps.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <react/renderer/components/image/ImageProps.h>
1010
#include <react/renderer/components/image/conversions.h>
1111
#include <react/renderer/core/propsConversions.h>
12+
#include <react/renderer/debug/debugStringConvertibleUtils.h>
1213

1314
namespace facebook::react {
1415

@@ -282,4 +283,16 @@ folly::dynamic ImageProps::getDiffProps(const Props* prevProps) const {
282283

283284
#endif
284285

286+
#if RN_DEBUG_STRING_CONVERTIBLE
287+
SharedDebugStringConvertibleList ImageProps::getDebugProps() const {
288+
const auto& defaultImageProps = ImageProps();
289+
290+
return ViewProps::getDebugProps() +
291+
SharedDebugStringConvertibleList{
292+
debugStringConvertibleItem(
293+
"blurRadius", blurRadius, defaultImageProps.blurRadius),
294+
};
295+
}
296+
#endif
297+
285298
} // namespace facebook::react

packages/react-native/ReactCommon/react/renderer/components/image/ImageProps.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ class ImageProps final : public ViewProps {
5050
ComponentName getDiffPropsImplementationTarget() const override;
5151
folly::dynamic getDiffProps(const Props* prevProps) const override;
5252
#endif
53+
54+
#if RN_DEBUG_STRING_CONVERTIBLE
55+
SharedDebugStringConvertibleList getDebugProps() const override;
56+
#endif
5357
};
5458

5559
} // namespace facebook::react

0 commit comments

Comments
 (0)