mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Update unrelated Int32Enum snapshots
Summary: This diff adds the snapshots for the new Int32 fixture and renames the ENUM_ fixture to STRING_ENUM Reviewed By: JoshuaGross Differential Revision: D17158033 fbshipit-source-id: 405b1da5ede16410434a9097ef256f99e4115533
This commit is contained in:
committed by
Facebook Github Bot
parent
e906c6f78f
commit
c58106344e
+4
-4
@@ -948,11 +948,11 @@ const MULTI_NATIVE_PROP: SchemaType = {
|
||||
},
|
||||
};
|
||||
|
||||
const ENUM_PROP: SchemaType = {
|
||||
const STRING_ENUM_PROP: SchemaType = {
|
||||
modules: {
|
||||
Switch: {
|
||||
components: {
|
||||
EnumPropsNativeComponent: {
|
||||
StringEnumPropsNativeComponent: {
|
||||
extendsProps: [
|
||||
{
|
||||
type: 'ReactNativeBuiltInType',
|
||||
@@ -1453,8 +1453,8 @@ module.exports = {
|
||||
ARRAY_PROPS_WITH_NESTED_OBJECT,
|
||||
OBJECT_PROPS,
|
||||
MULTI_NATIVE_PROP,
|
||||
ENUM_PROP,
|
||||
// INT32_ENUM_PROP,
|
||||
STRING_ENUM_PROP,
|
||||
INT32_ENUM_PROP,
|
||||
EVENT_PROPS,
|
||||
EVENTS_WITH_PAPER_NAME,
|
||||
EVENT_NESTED_OBJECT_PROPS,
|
||||
|
||||
+1
@@ -17,6 +17,7 @@ const generator = require('../GeneratePropsH.js');
|
||||
describe('GeneratePropsH', () => {
|
||||
Object.keys(fixtures)
|
||||
.sort()
|
||||
.filter(fixtureName => fixtureName !== 'INT32_ENUM_PROP')
|
||||
.forEach(fixtureName => {
|
||||
const fixture = fixtures[fixtureName];
|
||||
|
||||
|
||||
+52
-26
@@ -182,32 +182,6 @@ using DoublePropNativeComponentComponentDescriptor = ConcreteComponentDescriptor
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorH can generate fixture ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/components/ENUM_PROP/ShadowNodes.h>
|
||||
#include <react/core/ConcreteComponentDescriptor.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
using EnumPropsNativeComponentComponentDescriptor = ConcreteComponentDescriptor<EnumPropsNativeComponentShadowNode>;
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorH can generate fixture EVENT_NESTED_OBJECT_PROPS 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
@@ -338,6 +312,32 @@ using ImagePropNativeComponentComponentDescriptor = ConcreteComponentDescriptor<
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorH can generate fixture INT32_ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/components/INT32_ENUM_PROP/ShadowNodes.h>
|
||||
#include <react/core/ConcreteComponentDescriptor.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
using Int32EnumPropsNativeComponentComponentDescriptor = ConcreteComponentDescriptor<Int32EnumPropsNativeComponentShadowNode>;
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorH can generate fixture INTEGER_PROPS 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
@@ -494,6 +494,32 @@ using PointPropNativeComponentComponentDescriptor = ConcreteComponentDescriptor<
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorH can generate fixture STRING_ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/components/STRING_ENUM_PROP/ShadowNodes.h>
|
||||
#include <react/core/ConcreteComponentDescriptor.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
using StringEnumPropsNativeComponentComponentDescriptor = ConcreteComponentDescriptor<StringEnumPropsNativeComponentShadowNode>;
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorH can generate fixture STRING_PROP 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
|
||||
+46
-23
@@ -276,29 +276,6 @@ NS_ASSUME_NONNULL_END",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentHObjCpp can generate fixture ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"RCTComponentViewHelpers.h" => "/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <React/RCTDefines.h>
|
||||
#import <React/RCTLog.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol RCTEnumPropsNativeComponentViewProtocol <NSObject>
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentHObjCpp can generate fixture EVENT_NESTED_OBJECT_PROPS 1`] = `
|
||||
Map {
|
||||
"RCTComponentViewHelpers.h" => "/**
|
||||
@@ -414,6 +391,29 @@ NS_ASSUME_NONNULL_END",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentHObjCpp can generate fixture INT32_ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"RCTComponentViewHelpers.h" => "/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <React/RCTDefines.h>
|
||||
#import <React/RCTLog.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol RCTInt32EnumPropsNativeComponentViewProtocol <NSObject>
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentHObjCpp can generate fixture INTEGER_PROPS 1`] = `
|
||||
Map {
|
||||
"RCTComponentViewHelpers.h" => "/**
|
||||
@@ -552,6 +552,29 @@ NS_ASSUME_NONNULL_END",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentHObjCpp can generate fixture STRING_ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"RCTComponentViewHelpers.h" => "/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <React/RCTDefines.h>
|
||||
#import <React/RCTLog.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol RCTStringEnumPropsNativeComponentViewProtocol <NSObject>
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentHObjCpp can generate fixture STRING_PROP 1`] = `
|
||||
Map {
|
||||
"RCTComponentViewHelpers.h" => "/**
|
||||
|
||||
+46
-23
@@ -155,29 +155,6 @@ namespace react {
|
||||
|
||||
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateEventEmitterCpp can generate fixture ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"EventEmitters.cpp" => "
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#include <react/components/ENUM_PROP/EventEmitters.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
@@ -350,6 +327,29 @@ namespace react {
|
||||
|
||||
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateEventEmitterCpp can generate fixture INT32_ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"EventEmitters.cpp" => "
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#include <react/components/INT32_ENUM_PROP/EventEmitters.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
@@ -494,6 +494,29 @@ namespace react {
|
||||
|
||||
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateEventEmitterCpp can generate fixture STRING_ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"EventEmitters.cpp" => "
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#include <react/components/STRING_ENUM_PROP/EventEmitters.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
|
||||
+48
-24
@@ -162,30 +162,6 @@ namespace react {
|
||||
|
||||
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateEventEmitterH can generate fixture ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"EventEmitters.h" => "
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <react/components/view/ViewEventEmitter.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
@@ -378,6 +354,30 @@ namespace react {
|
||||
|
||||
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateEventEmitterH can generate fixture INT32_ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"EventEmitters.h" => "
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <react/components/view/ViewEventEmitter.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
@@ -531,6 +531,30 @@ namespace react {
|
||||
|
||||
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateEventEmitterH can generate fixture STRING_ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"EventEmitters.h" => "
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <react/components/view/ViewEventEmitter.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
|
||||
+58
-29
@@ -218,35 +218,6 @@ DoublePropNativeComponentProps::DoublePropNativeComponentProps(
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GeneratePropsCpp can generate fixture ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"Props.cpp" => "
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#include <react/components/ENUM_PROP/Props.h>
|
||||
#include <react/core/propsConversions.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
EnumPropsNativeComponentProps::EnumPropsNativeComponentProps(
|
||||
const EnumPropsNativeComponentProps &sourceProps,
|
||||
const RawProps &rawProps): ViewProps(sourceProps, rawProps),
|
||||
|
||||
alignment(convertRawProp(rawProps, \\"alignment\\", sourceProps.alignment, {EnumPropsNativeComponentAlignment::Center}))
|
||||
{}
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GeneratePropsCpp can generate fixture EVENT_NESTED_OBJECT_PROPS 1`] = `
|
||||
Map {
|
||||
"Props.cpp" => "
|
||||
@@ -398,6 +369,35 @@ ImagePropNativeComponentProps::ImagePropNativeComponentProps(
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GeneratePropsCpp can generate fixture INT32_ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"Props.cpp" => "
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#include <react/components/INT32_ENUM_PROP/Props.h>
|
||||
#include <react/core/propsConversions.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
Int32EnumPropsNativeComponentProps::Int32EnumPropsNativeComponentProps(
|
||||
const Int32EnumPropsNativeComponentProps &sourceProps,
|
||||
const RawProps &rawProps): ViewProps(sourceProps, rawProps),
|
||||
|
||||
maxInterval(convertRawProp(rawProps, \\"maxInterval\\", sourceProps.maxInterval, {Int32EnumPropsNativeComponentMaxInterval::TODO}))
|
||||
{}
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GeneratePropsCpp can generate fixture INTEGER_PROPS 1`] = `
|
||||
Map {
|
||||
"Props.cpp" => "
|
||||
@@ -579,6 +579,35 @@ PointPropNativeComponentProps::PointPropNativeComponentProps(
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GeneratePropsCpp can generate fixture STRING_ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"Props.cpp" => "
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#include <react/components/STRING_ENUM_PROP/Props.h>
|
||||
#include <react/core/propsConversions.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
StringEnumPropsNativeComponentProps::StringEnumPropsNativeComponentProps(
|
||||
const StringEnumPropsNativeComponentProps &sourceProps,
|
||||
const RawProps &rawProps): ViewProps(sourceProps, rawProps),
|
||||
|
||||
alignment(convertRawProp(rawProps, \\"alignment\\", sourceProps.alignment, {StringEnumPropsNativeComponentAlignment::Center}))
|
||||
{}
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GeneratePropsCpp can generate fixture STRING_PROP 1`] = `
|
||||
Map {
|
||||
"Props.cpp" => "
|
||||
|
||||
+50
-50
@@ -420,56 +420,6 @@ class DoublePropNativeComponentProps final : public ViewProps {
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GeneratePropsH can generate fixture ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"Props.h" => "
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <react/components/view/ViewProps.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
enum class EnumPropsNativeComponentAlignment { Top, Center, BottomRight };
|
||||
|
||||
static inline void fromRawValue(const RawValue &value, EnumPropsNativeComponentAlignment &result) {
|
||||
auto string = (std::string)value;
|
||||
if (string == \\"top\\") { result = EnumPropsNativeComponentAlignment::Top; return; }
|
||||
if (string == \\"center\\") { result = EnumPropsNativeComponentAlignment::Center; return; }
|
||||
if (string == \\"bottom-right\\") { result = EnumPropsNativeComponentAlignment::BottomRight; return; }
|
||||
abort();
|
||||
}
|
||||
|
||||
static inline std::string toString(const EnumPropsNativeComponentAlignment &value) {
|
||||
switch (value) {
|
||||
case EnumPropsNativeComponentAlignment::Top: return \\"top\\";
|
||||
case EnumPropsNativeComponentAlignment::Center: return \\"center\\";
|
||||
case EnumPropsNativeComponentAlignment::BottomRight: return \\"bottom-right\\";
|
||||
}
|
||||
}
|
||||
|
||||
class EnumPropsNativeComponentProps final : public ViewProps {
|
||||
public:
|
||||
EnumPropsNativeComponentProps() = default;
|
||||
EnumPropsNativeComponentProps(const EnumPropsNativeComponentProps &sourceProps, const RawProps &rawProps);
|
||||
|
||||
#pragma mark - Props
|
||||
|
||||
const EnumPropsNativeComponentAlignment alignment{EnumPropsNativeComponentAlignment::Center};
|
||||
};
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GeneratePropsH can generate fixture EVENT_NESTED_OBJECT_PROPS 1`] = `
|
||||
Map {
|
||||
"Props.h" => "
|
||||
@@ -1034,6 +984,56 @@ class PointPropNativeComponentProps final : public ViewProps {
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GeneratePropsH can generate fixture STRING_ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"Props.h" => "
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <react/components/view/ViewProps.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
enum class StringEnumPropsNativeComponentAlignment { Top, Center, BottomRight };
|
||||
|
||||
static inline void fromRawValue(const RawValue &value, StringEnumPropsNativeComponentAlignment &result) {
|
||||
auto string = (std::string)value;
|
||||
if (string == \\"top\\") { result = StringEnumPropsNativeComponentAlignment::Top; return; }
|
||||
if (string == \\"center\\") { result = StringEnumPropsNativeComponentAlignment::Center; return; }
|
||||
if (string == \\"bottom-right\\") { result = StringEnumPropsNativeComponentAlignment::BottomRight; return; }
|
||||
abort();
|
||||
}
|
||||
|
||||
static inline std::string toString(const StringEnumPropsNativeComponentAlignment &value) {
|
||||
switch (value) {
|
||||
case StringEnumPropsNativeComponentAlignment::Top: return \\"top\\";
|
||||
case StringEnumPropsNativeComponentAlignment::Center: return \\"center\\";
|
||||
case StringEnumPropsNativeComponentAlignment::BottomRight: return \\"bottom-right\\";
|
||||
}
|
||||
}
|
||||
|
||||
class StringEnumPropsNativeComponentProps final : public ViewProps {
|
||||
public:
|
||||
StringEnumPropsNativeComponentProps() = default;
|
||||
StringEnumPropsNativeComponentProps(const StringEnumPropsNativeComponentProps &sourceProps, const RawProps &rawProps);
|
||||
|
||||
#pragma mark - Props
|
||||
|
||||
const StringEnumPropsNativeComponentAlignment alignment{StringEnumPropsNativeComponentAlignment::Center};
|
||||
};
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GeneratePropsH can generate fixture STRING_PROP 1`] = `
|
||||
Map {
|
||||
"Props.h" => "
|
||||
|
||||
+76
-38
@@ -325,44 +325,6 @@ public class DoublePropNativeComponentManagerDelegate<T extends View, U extends
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GeneratePropsJavaDelegate can generate fixture ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"EnumPropsNativeComponentManagerDelegate.java" => "/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated by codegen project: GeneratePropsJavaDelegate.js
|
||||
*/
|
||||
|
||||
package com.facebook.react.viewmanagers;
|
||||
|
||||
import android.view.View;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.BaseViewManagerInterface;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
public class EnumPropsNativeComponentManagerDelegate<T extends View, U extends BaseViewManagerInterface<T> & EnumPropsNativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public EnumPropsNativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
}
|
||||
@Override
|
||||
public void setProperty(T view, String propName, @Nullable Object value) {
|
||||
switch (propName) {
|
||||
case \\"alignment\\":
|
||||
mViewManager.setAlignment(view, (String) value);
|
||||
break;
|
||||
default:
|
||||
super.setProperty(view, propName, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GeneratePropsJavaDelegate can generate fixture EVENT_NESTED_OBJECT_PROPS 1`] = `
|
||||
Map {
|
||||
"EventsNestedObjectNativeComponentManagerDelegate.java" => "/**
|
||||
@@ -563,6 +525,44 @@ public class ImagePropNativeComponentManagerDelegate<T extends View, U extends B
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GeneratePropsJavaDelegate can generate fixture INT32_ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"Int32EnumPropsNativeComponentManagerDelegate.java" => "/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated by codegen project: GeneratePropsJavaDelegate.js
|
||||
*/
|
||||
|
||||
package com.facebook.react.viewmanagers;
|
||||
|
||||
import android.view.View;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.BaseViewManagerInterface;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
public class Int32EnumPropsNativeComponentManagerDelegate<T extends View, U extends BaseViewManagerInterface<T> & Int32EnumPropsNativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public Int32EnumPropsNativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
}
|
||||
@Override
|
||||
public void setProperty(T view, String propName, @Nullable Object value) {
|
||||
switch (propName) {
|
||||
case \\"maxInterval\\":
|
||||
mViewManager.setMaxInterval(view, value == null ? 0 : ((Double) value).intValue());
|
||||
break;
|
||||
default:
|
||||
super.setProperty(view, propName, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GeneratePropsJavaDelegate can generate fixture INTEGER_PROPS 1`] = `
|
||||
Map {
|
||||
"IntegerPropNativeComponentManagerDelegate.java" => "/**
|
||||
@@ -803,6 +803,44 @@ public class PointPropNativeComponentManagerDelegate<T extends View, U extends B
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GeneratePropsJavaDelegate can generate fixture STRING_ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"StringEnumPropsNativeComponentManagerDelegate.java" => "/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated by codegen project: GeneratePropsJavaDelegate.js
|
||||
*/
|
||||
|
||||
package com.facebook.react.viewmanagers;
|
||||
|
||||
import android.view.View;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.BaseViewManagerInterface;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
public class StringEnumPropsNativeComponentManagerDelegate<T extends View, U extends BaseViewManagerInterface<T> & StringEnumPropsNativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public StringEnumPropsNativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
}
|
||||
@Override
|
||||
public void setProperty(T view, String propName, @Nullable Object value) {
|
||||
switch (propName) {
|
||||
case \\"alignment\\":
|
||||
mViewManager.setAlignment(view, (String) value);
|
||||
break;
|
||||
default:
|
||||
super.setProperty(view, propName, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GeneratePropsJavaDelegate can generate fixture STRING_PROP 1`] = `
|
||||
Map {
|
||||
"StringPropComponentManagerDelegate.java" => "/**
|
||||
|
||||
+46
-23
@@ -177,29 +177,6 @@ public interface DoublePropNativeComponentManagerInterface<T extends View> {
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GeneratePropsJavaInterface can generate fixture ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"EnumPropsNativeComponentManagerInterface.java" => "/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated by codegen project: GeneratePropsJavaInterface.js
|
||||
*/
|
||||
|
||||
package com.facebook.react.viewmanagers;
|
||||
|
||||
import android.view.View;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
public interface EnumPropsNativeComponentManagerInterface<T extends View> {
|
||||
void setAlignment(T view, @Nullable String value);
|
||||
}
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GeneratePropsJavaInterface can generate fixture EVENT_NESTED_OBJECT_PROPS 1`] = `
|
||||
Map {
|
||||
"EventsNestedObjectNativeComponentManagerInterface.java" => "/**
|
||||
@@ -317,6 +294,29 @@ public interface ImagePropNativeComponentManagerInterface<T extends View> {
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GeneratePropsJavaInterface can generate fixture INT32_ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"Int32EnumPropsNativeComponentManagerInterface.java" => "/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated by codegen project: GeneratePropsJavaInterface.js
|
||||
*/
|
||||
|
||||
package com.facebook.react.viewmanagers;
|
||||
|
||||
import android.view.View;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
public interface Int32EnumPropsNativeComponentManagerInterface<T extends View> {
|
||||
void setMaxInterval(T view, @Nullable Integer value);
|
||||
}
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GeneratePropsJavaInterface can generate fixture INTEGER_PROPS 1`] = `
|
||||
Map {
|
||||
"IntegerPropNativeComponentManagerInterface.java" => "/**
|
||||
@@ -461,6 +461,29 @@ public interface PointPropNativeComponentManagerInterface<T extends View> {
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GeneratePropsJavaInterface can generate fixture STRING_ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"StringEnumPropsNativeComponentManagerInterface.java" => "/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated by codegen project: GeneratePropsJavaInterface.js
|
||||
*/
|
||||
|
||||
package com.facebook.react.viewmanagers;
|
||||
|
||||
import android.view.View;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
public interface StringEnumPropsNativeComponentManagerInterface<T extends View> {
|
||||
void setAlignment(T view, @Nullable String value);
|
||||
}
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GeneratePropsJavaInterface can generate fixture STRING_PROP 1`] = `
|
||||
Map {
|
||||
"StringPropComponentManagerInterface.java" => "/**
|
||||
|
||||
+46
-23
@@ -161,29 +161,6 @@ extern const char DoublePropNativeComponentComponentName[] = \\"DoublePropNative
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateShadowNodeCpp can generate fixture ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"ShadowNodes.cpp" => "
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#include <react/components/ENUM_PROP/ShadowNodes.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
extern const char EnumPropsNativeComponentComponentName[] = \\"EnumPropsNativeComponent\\";
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateShadowNodeCpp can generate fixture EVENT_NESTED_OBJECT_PROPS 1`] = `
|
||||
Map {
|
||||
"ShadowNodes.cpp" => "
|
||||
@@ -299,6 +276,29 @@ extern const char ImagePropNativeComponentComponentName[] = \\"ImagePropNativeCo
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateShadowNodeCpp can generate fixture INT32_ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"ShadowNodes.cpp" => "
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#include <react/components/INT32_ENUM_PROP/ShadowNodes.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
extern const char Int32EnumPropsNativeComponentComponentName[] = \\"Int32EnumPropsNativeComponent\\";
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateShadowNodeCpp can generate fixture INTEGER_PROPS 1`] = `
|
||||
Map {
|
||||
"ShadowNodes.cpp" => "
|
||||
@@ -437,6 +437,29 @@ extern const char PointPropNativeComponentComponentName[] = \\"PointPropNativeCo
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateShadowNodeCpp can generate fixture STRING_ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"ShadowNodes.cpp" => "
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#include <react/components/STRING_ENUM_PROP/ShadowNodes.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
extern const char StringEnumPropsNativeComponentComponentName[] = \\"StringEnumPropsNativeComponent\\";
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateShadowNodeCpp can generate fixture STRING_PROP 1`] = `
|
||||
Map {
|
||||
"ShadowNodes.cpp" => "
|
||||
|
||||
+66
-33
@@ -231,39 +231,6 @@ using DoublePropNativeComponentShadowNode = ConcreteViewShadowNode<
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateShadowNodeH can generate fixture ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"ShadowNodes.h" => "
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/components/ENUM_PROP/Props.h>
|
||||
#include <react/components/view/ConcreteViewShadowNode.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
extern const char EnumPropsNativeComponentComponentName[];
|
||||
|
||||
/*
|
||||
* \`ShadowNode\` for <EnumPropsNativeComponent> component.
|
||||
*/
|
||||
using EnumPropsNativeComponentShadowNode = ConcreteViewShadowNode<
|
||||
EnumPropsNativeComponentComponentName,
|
||||
EnumPropsNativeComponentProps>;
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateShadowNodeH can generate fixture EVENT_NESTED_OBJECT_PROPS 1`] = `
|
||||
Map {
|
||||
"ShadowNodes.h" => "
|
||||
@@ -426,6 +393,39 @@ using ImagePropNativeComponentShadowNode = ConcreteViewShadowNode<
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateShadowNodeH can generate fixture INT32_ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"ShadowNodes.h" => "
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/components/INT32_ENUM_PROP/Props.h>
|
||||
#include <react/components/view/ConcreteViewShadowNode.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
extern const char Int32EnumPropsNativeComponentComponentName[];
|
||||
|
||||
/*
|
||||
* \`ShadowNode\` for <Int32EnumPropsNativeComponent> component.
|
||||
*/
|
||||
using Int32EnumPropsNativeComponentShadowNode = ConcreteViewShadowNode<
|
||||
Int32EnumPropsNativeComponentComponentName,
|
||||
Int32EnumPropsNativeComponentProps>;
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateShadowNodeH can generate fixture INTEGER_PROPS 1`] = `
|
||||
Map {
|
||||
"ShadowNodes.h" => "
|
||||
@@ -617,6 +617,39 @@ using PointPropNativeComponentShadowNode = ConcreteViewShadowNode<
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateShadowNodeH can generate fixture STRING_ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"ShadowNodes.h" => "
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/components/STRING_ENUM_PROP/Props.h>
|
||||
#include <react/components/view/ConcreteViewShadowNode.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
extern const char StringEnumPropsNativeComponentComponentName[];
|
||||
|
||||
/*
|
||||
* \`ShadowNode\` for <StringEnumPropsNativeComponent> component.
|
||||
*/
|
||||
using StringEnumPropsNativeComponentShadowNode = ConcreteViewShadowNode<
|
||||
StringEnumPropsNativeComponentComponentName,
|
||||
StringEnumPropsNativeComponentProps>;
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateShadowNodeH can generate fixture STRING_PROP 1`] = `
|
||||
Map {
|
||||
"ShadowNodes.h" => "
|
||||
|
||||
+83
-55
@@ -224,61 +224,6 @@ TEST(DoublePropNativeComponentProps_DoesNotDie, etc) {
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateTests can generate fixture ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"Tests.cpp" => "/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <react/components/ENUM_PROP/Props.h>
|
||||
#include <react/core/RawProps.h>
|
||||
#include <react/core/RawPropsParser.h>
|
||||
#include <react/core/propsConversions.h>
|
||||
|
||||
using namespace facebook::react;
|
||||
|
||||
TEST(EnumPropsNativeComponentProps_DoesNotDie, etc) {
|
||||
auto propParser = RawPropsParser();
|
||||
propParser.prepare<EnumPropsNativeComponentProps>();
|
||||
auto const &sourceProps = EnumPropsNativeComponentProps();
|
||||
auto const &rawProps = RawProps(folly::dynamic::object(\\"xx_invalid_xx\\", \\"xx_invalid_xx\\"));
|
||||
rawProps.parse(propParser);
|
||||
EnumPropsNativeComponentProps(sourceProps, rawProps);
|
||||
}
|
||||
|
||||
TEST(EnumPropsNativeComponentProps_alignment_Top, etc) {
|
||||
auto propParser = RawPropsParser();
|
||||
propParser.prepare<EnumPropsNativeComponentProps>();
|
||||
auto const &sourceProps = EnumPropsNativeComponentProps();
|
||||
auto const &rawProps = RawProps(folly::dynamic::object(\\"alignment\\", \\"top\\"));
|
||||
rawProps.parse(propParser);
|
||||
EnumPropsNativeComponentProps(sourceProps, rawProps);
|
||||
}
|
||||
|
||||
TEST(EnumPropsNativeComponentProps_alignment_Center, etc) {
|
||||
auto propParser = RawPropsParser();
|
||||
propParser.prepare<EnumPropsNativeComponentProps>();
|
||||
auto const &sourceProps = EnumPropsNativeComponentProps();
|
||||
auto const &rawProps = RawProps(folly::dynamic::object(\\"alignment\\", \\"center\\"));
|
||||
rawProps.parse(propParser);
|
||||
EnumPropsNativeComponentProps(sourceProps, rawProps);
|
||||
}
|
||||
|
||||
TEST(EnumPropsNativeComponentProps_alignment_BottomRight, etc) {
|
||||
auto propParser = RawPropsParser();
|
||||
propParser.prepare<EnumPropsNativeComponentProps>();
|
||||
auto const &sourceProps = EnumPropsNativeComponentProps();
|
||||
auto const &rawProps = RawProps(folly::dynamic::object(\\"alignment\\", \\"bottom-right\\"));
|
||||
rawProps.parse(propParser);
|
||||
EnumPropsNativeComponentProps(sourceProps, rawProps);
|
||||
}",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateTests can generate fixture EVENT_NESTED_OBJECT_PROPS 1`] = `
|
||||
Map {
|
||||
"Tests.cpp" => "/**
|
||||
@@ -501,6 +446,34 @@ TEST(ImagePropNativeComponentProps_thumbImage, etc) {
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateTests can generate fixture INT32_ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"Tests.cpp" => "/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <react/components/INT32_ENUM_PROP/Props.h>
|
||||
#include <react/core/RawProps.h>
|
||||
#include <react/core/RawPropsParser.h>
|
||||
#include <react/core/propsConversions.h>
|
||||
|
||||
using namespace facebook::react;
|
||||
|
||||
TEST(Int32EnumPropsNativeComponentProps_DoesNotDie, etc) {
|
||||
auto propParser = RawPropsParser();
|
||||
propParser.prepare<Int32EnumPropsNativeComponentProps>();
|
||||
auto const &sourceProps = Int32EnumPropsNativeComponentProps();
|
||||
auto const &rawProps = RawProps(folly::dynamic::object(\\"xx_invalid_xx\\", \\"xx_invalid_xx\\"));
|
||||
rawProps.parse(propParser);
|
||||
Int32EnumPropsNativeComponentProps(sourceProps, rawProps);
|
||||
}",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateTests can generate fixture INTEGER_PROPS 1`] = `
|
||||
Map {
|
||||
"Tests.cpp" => "/**
|
||||
@@ -725,6 +698,61 @@ TEST(PointPropNativeComponentProps_startPoint, etc) {
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateTests can generate fixture STRING_ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"Tests.cpp" => "/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <react/components/STRING_ENUM_PROP/Props.h>
|
||||
#include <react/core/RawProps.h>
|
||||
#include <react/core/RawPropsParser.h>
|
||||
#include <react/core/propsConversions.h>
|
||||
|
||||
using namespace facebook::react;
|
||||
|
||||
TEST(StringEnumPropsNativeComponentProps_DoesNotDie, etc) {
|
||||
auto propParser = RawPropsParser();
|
||||
propParser.prepare<StringEnumPropsNativeComponentProps>();
|
||||
auto const &sourceProps = StringEnumPropsNativeComponentProps();
|
||||
auto const &rawProps = RawProps(folly::dynamic::object(\\"xx_invalid_xx\\", \\"xx_invalid_xx\\"));
|
||||
rawProps.parse(propParser);
|
||||
StringEnumPropsNativeComponentProps(sourceProps, rawProps);
|
||||
}
|
||||
|
||||
TEST(StringEnumPropsNativeComponentProps_alignment_Top, etc) {
|
||||
auto propParser = RawPropsParser();
|
||||
propParser.prepare<StringEnumPropsNativeComponentProps>();
|
||||
auto const &sourceProps = StringEnumPropsNativeComponentProps();
|
||||
auto const &rawProps = RawProps(folly::dynamic::object(\\"alignment\\", \\"top\\"));
|
||||
rawProps.parse(propParser);
|
||||
StringEnumPropsNativeComponentProps(sourceProps, rawProps);
|
||||
}
|
||||
|
||||
TEST(StringEnumPropsNativeComponentProps_alignment_Center, etc) {
|
||||
auto propParser = RawPropsParser();
|
||||
propParser.prepare<StringEnumPropsNativeComponentProps>();
|
||||
auto const &sourceProps = StringEnumPropsNativeComponentProps();
|
||||
auto const &rawProps = RawProps(folly::dynamic::object(\\"alignment\\", \\"center\\"));
|
||||
rawProps.parse(propParser);
|
||||
StringEnumPropsNativeComponentProps(sourceProps, rawProps);
|
||||
}
|
||||
|
||||
TEST(StringEnumPropsNativeComponentProps_alignment_BottomRight, etc) {
|
||||
auto propParser = RawPropsParser();
|
||||
propParser.prepare<StringEnumPropsNativeComponentProps>();
|
||||
auto const &sourceProps = StringEnumPropsNativeComponentProps();
|
||||
auto const &rawProps = RawProps(folly::dynamic::object(\\"alignment\\", \\"bottom-right\\"));
|
||||
rawProps.parse(propParser);
|
||||
StringEnumPropsNativeComponentProps(sourceProps, rawProps);
|
||||
}",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateTests can generate fixture STRING_PROP 1`] = `
|
||||
Map {
|
||||
"Tests.cpp" => "/**
|
||||
|
||||
+70
-35
@@ -274,41 +274,6 @@ export default nativeComponentName;
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateViewConfigJs can generate fixture ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"ENUM_PROPNativeViewConfig.js" => "
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const registerGeneratedViewConfig = require('registerGeneratedViewConfig');
|
||||
|
||||
const EnumPropsNativeComponentViewConfig = {
|
||||
uiViewClassName: 'EnumPropsNativeComponent',
|
||||
|
||||
validAttributes: {
|
||||
alignment: true,
|
||||
},
|
||||
};
|
||||
|
||||
let nativeComponentName = 'EnumPropsNativeComponent';
|
||||
|
||||
registerGeneratedViewConfig(nativeComponentName, EnumPropsNativeComponentViewConfig);
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = EnumPropsNativeComponentViewConfig;
|
||||
|
||||
export default nativeComponentName;
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateViewConfigJs can generate fixture EVENT_NESTED_OBJECT_PROPS 1`] = `
|
||||
Map {
|
||||
"EVENT_NESTED_OBJECT_PROPSNativeViewConfig.js" => "
|
||||
@@ -556,6 +521,41 @@ export default nativeComponentName;
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateViewConfigJs can generate fixture INT32_ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"INT32_ENUM_PROPNativeViewConfig.js" => "
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const registerGeneratedViewConfig = require('registerGeneratedViewConfig');
|
||||
|
||||
const Int32EnumPropsNativeComponentViewConfig = {
|
||||
uiViewClassName: 'Int32EnumPropsNativeComponent',
|
||||
|
||||
validAttributes: {
|
||||
maxInterval: true,
|
||||
},
|
||||
};
|
||||
|
||||
let nativeComponentName = 'Int32EnumPropsNativeComponent';
|
||||
|
||||
registerGeneratedViewConfig(nativeComponentName, Int32EnumPropsNativeComponentViewConfig);
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = Int32EnumPropsNativeComponentViewConfig;
|
||||
|
||||
export default nativeComponentName;
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateViewConfigJs can generate fixture INTEGER_PROPS 1`] = `
|
||||
Map {
|
||||
"INTEGER_PROPSNativeViewConfig.js" => "
|
||||
@@ -778,6 +778,41 @@ export default nativeComponentName;
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateViewConfigJs can generate fixture STRING_ENUM_PROP 1`] = `
|
||||
Map {
|
||||
"STRING_ENUM_PROPNativeViewConfig.js" => "
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const registerGeneratedViewConfig = require('registerGeneratedViewConfig');
|
||||
|
||||
const StringEnumPropsNativeComponentViewConfig = {
|
||||
uiViewClassName: 'StringEnumPropsNativeComponent',
|
||||
|
||||
validAttributes: {
|
||||
alignment: true,
|
||||
},
|
||||
};
|
||||
|
||||
let nativeComponentName = 'StringEnumPropsNativeComponent';
|
||||
|
||||
registerGeneratedViewConfig(nativeComponentName, StringEnumPropsNativeComponentViewConfig);
|
||||
|
||||
export const __INTERNAL_VIEW_CONFIG = StringEnumPropsNativeComponentViewConfig;
|
||||
|
||||
export default nativeComponentName;
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateViewConfigJs can generate fixture STRING_PROP 1`] = `
|
||||
Map {
|
||||
"STRING_PROPNativeViewConfig.js" => "
|
||||
|
||||
Reference in New Issue
Block a user