mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add object prop tests for unchanged fixtures
Summary: This diff adds snapshot updates for the new object props test fixtures whose implementation does not need to change (e.g. event emitter files will not change when object props are implemented). This is for easier reviewability in later diffs. Notes that in the files that will change, we're temporarily filtering the OBJECT_PROPS test fixture Reviewed By: TheSavior Differential Revision: D16759124 fbshipit-source-id: 8aae063614f762c8bd7bf092b0d274804c38dd14
This commit is contained in:
committed by
Facebook Github Bot
parent
06259a7575
commit
76b8b1dc8b
+1
-1
@@ -1152,7 +1152,7 @@ module.exports = {
|
||||
IMAGE_PROP,
|
||||
POINT_PROP,
|
||||
ARRAY_PROPS,
|
||||
// OBJECT_PROPS,
|
||||
OBJECT_PROPS,
|
||||
MULTI_NATIVE_PROP,
|
||||
ENUM_PROP,
|
||||
EVENT_PROPS,
|
||||
|
||||
+1
@@ -17,6 +17,7 @@ const generator = require('../GeneratePropsCpp.js');
|
||||
describe('GeneratePropsCpp', () => {
|
||||
Object.keys(fixtures)
|
||||
.sort()
|
||||
.filter(fixtureName => fixtureName !== 'OBJECT_PROPS')
|
||||
.forEach(fixtureName => {
|
||||
const fixture = fixtures[fixtureName];
|
||||
|
||||
|
||||
+1
@@ -17,6 +17,7 @@ const generator = require('../GeneratePropsH.js');
|
||||
describe('GeneratePropsH', () => {
|
||||
Object.keys(fixtures)
|
||||
.sort()
|
||||
.filter(fixtureName => fixtureName !== 'OBJECT_PROPS')
|
||||
.forEach(fixtureName => {
|
||||
const fixture = fixtures[fixtureName];
|
||||
|
||||
|
||||
Vendored
+1
@@ -17,6 +17,7 @@ const generator = require('../GeneratePropsJavaDelegate.js');
|
||||
describe('GeneratePropsJavaDelegate', () => {
|
||||
Object.keys(fixtures)
|
||||
.sort()
|
||||
.filter(fixtureName => fixtureName !== 'OBJECT_PROPS')
|
||||
.forEach(fixtureName => {
|
||||
const fixture = fixtures[fixtureName];
|
||||
|
||||
|
||||
packages/react-native-codegen/src/generators/components/__tests__/GeneratePropsJavaInterface-test.js
Vendored
+1
@@ -17,6 +17,7 @@ const generator = require('../GeneratePropsJavaInterface.js');
|
||||
describe('GeneratePropsJavaInterface', () => {
|
||||
Object.keys(fixtures)
|
||||
.sort()
|
||||
.filter(fixtureName => fixtureName !== 'OBJECT_PROPS')
|
||||
.forEach(fixtureName => {
|
||||
const fixture = fixtures[fixtureName];
|
||||
|
||||
|
||||
Vendored
+1
@@ -17,6 +17,7 @@ const generator = require('../GenerateViewConfigJs.js');
|
||||
describe('GenerateViewConfigJs', () => {
|
||||
Object.keys(fixtures)
|
||||
.sort()
|
||||
.filter(fixtureName => fixtureName !== 'OBJECT_PROPS')
|
||||
.forEach(fixtureName => {
|
||||
const fixture = fixtures[fixtureName];
|
||||
|
||||
|
||||
+26
@@ -390,6 +390,32 @@ using NoPropsNoEventsComponentComponentDescriptor = ConcreteComponentDescriptor<
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorH can generate fixture OBJECT_PROPS 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/OBJECT_PROPS/ShadowNodes.h>
|
||||
#include <react/core/ConcreteComponentDescriptor.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
using ObjectPropsComponentDescriptor = ConcreteComponentDescriptor<ObjectPropsShadowNode>;
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentDescriptorH can generate fixture POINT_PROP 1`] = `
|
||||
Map {
|
||||
"ComponentDescriptors.h" => "
|
||||
|
||||
+23
@@ -444,6 +444,29 @@ NS_ASSUME_NONNULL_END",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentHObjCpp can generate fixture OBJECT_PROPS 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 RCTObjectPropsViewProtocol <NSObject>
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateComponentHObjCpp can generate fixture POINT_PROP 1`] = `
|
||||
Map {
|
||||
"RCTComponentViewHelpers.h" => "/**
|
||||
|
||||
+23
@@ -402,6 +402,29 @@ namespace react {
|
||||
|
||||
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateEventEmitterCpp can generate fixture OBJECT_PROPS 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/OBJECT_PROPS/EventEmitters.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
|
||||
+24
@@ -435,6 +435,30 @@ namespace react {
|
||||
|
||||
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateEventEmitterH can generate fixture OBJECT_PROPS 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
|
||||
",
|
||||
|
||||
+23
@@ -345,6 +345,29 @@ extern const char NoPropsNoEventsComponentComponentName[] = \\"NoPropsNoEventsCo
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateShadowNodeCpp can generate fixture OBJECT_PROPS 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/OBJECT_PROPS/ShadowNodes.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
extern const char ObjectPropsComponentName[] = \\"ObjectProps\\";
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateShadowNodeCpp can generate fixture POINT_PROP 1`] = `
|
||||
Map {
|
||||
"ShadowNodes.cpp" => "
|
||||
|
||||
+33
@@ -485,6 +485,39 @@ using NoPropsNoEventsComponentShadowNode = ConcreteViewShadowNode<
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateShadowNodeH can generate fixture OBJECT_PROPS 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/OBJECT_PROPS/Props.h>
|
||||
#include <react/components/view/ConcreteViewShadowNode.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
|
||||
extern const char ObjectPropsComponentName[];
|
||||
|
||||
/*
|
||||
* \`ShadowNode\` for <ObjectProps> component.
|
||||
*/
|
||||
using ObjectPropsShadowNode = ConcreteViewShadowNode<
|
||||
ObjectPropsComponentName,
|
||||
ObjectPropsProps>;
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateShadowNodeH can generate fixture POINT_PROP 1`] = `
|
||||
Map {
|
||||
"ShadowNodes.h" => "
|
||||
|
||||
+28
@@ -603,6 +603,34 @@ TEST(NoPropsNoEventsComponentProps_DoesNotDie, etc) {
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateTests can generate fixture OBJECT_PROPS 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/OBJECT_PROPS/Props.h>
|
||||
#include <react/core/RawProps.h>
|
||||
#include <react/core/RawPropsParser.h>
|
||||
#include <react/core/propsConversions.h>
|
||||
|
||||
using namespace facebook::react;
|
||||
|
||||
TEST(ObjectPropsProps_DoesNotDie, etc) {
|
||||
auto propParser = RawPropsParser();
|
||||
propParser.prepare<ObjectPropsProps>();
|
||||
auto const &sourceProps = ObjectPropsProps();
|
||||
auto const &rawProps = RawProps(folly::dynamic::object(\\"xx_invalid_xx\\", \\"xx_invalid_xx\\"));
|
||||
rawProps.parse(propParser);
|
||||
ObjectPropsProps(sourceProps, rawProps);
|
||||
}",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`GenerateTests can generate fixture POINT_PROP 1`] = `
|
||||
Map {
|
||||
"Tests.cpp" => "/**
|
||||
|
||||
Reference in New Issue
Block a user