Skip to content

Commit 76b8b1d

Browse files
rickhanloniifacebook-github-bot
authored andcommitted
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
1 parent 06259a7 commit 76b8b1d

13 files changed

+186
-1
lines changed

packages/react-native-codegen/src/generators/components/__test_fixtures__/fixtures.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,7 @@ module.exports = {
11521152
IMAGE_PROP,
11531153
POINT_PROP,
11541154
ARRAY_PROPS,
1155-
// OBJECT_PROPS,
1155+
OBJECT_PROPS,
11561156
MULTI_NATIVE_PROP,
11571157
ENUM_PROP,
11581158
EVENT_PROPS,

packages/react-native-codegen/src/generators/components/__tests__/GeneratePropsCpp-test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const generator = require('../GeneratePropsCpp.js');
1717
describe('GeneratePropsCpp', () => {
1818
Object.keys(fixtures)
1919
.sort()
20+
.filter(fixtureName => fixtureName !== 'OBJECT_PROPS')
2021
.forEach(fixtureName => {
2122
const fixture = fixtures[fixtureName];
2223

packages/react-native-codegen/src/generators/components/__tests__/GeneratePropsH-test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const generator = require('../GeneratePropsH.js');
1717
describe('GeneratePropsH', () => {
1818
Object.keys(fixtures)
1919
.sort()
20+
.filter(fixtureName => fixtureName !== 'OBJECT_PROPS')
2021
.forEach(fixtureName => {
2122
const fixture = fixtures[fixtureName];
2223

packages/react-native-codegen/src/generators/components/__tests__/GeneratePropsJavaDelegate-test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const generator = require('../GeneratePropsJavaDelegate.js');
1717
describe('GeneratePropsJavaDelegate', () => {
1818
Object.keys(fixtures)
1919
.sort()
20+
.filter(fixtureName => fixtureName !== 'OBJECT_PROPS')
2021
.forEach(fixtureName => {
2122
const fixture = fixtures[fixtureName];
2223

packages/react-native-codegen/src/generators/components/__tests__/GeneratePropsJavaInterface-test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const generator = require('../GeneratePropsJavaInterface.js');
1717
describe('GeneratePropsJavaInterface', () => {
1818
Object.keys(fixtures)
1919
.sort()
20+
.filter(fixtureName => fixtureName !== 'OBJECT_PROPS')
2021
.forEach(fixtureName => {
2122
const fixture = fixtures[fixtureName];
2223

packages/react-native-codegen/src/generators/components/__tests__/GenerateViewConfigJs-test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const generator = require('../GenerateViewConfigJs.js');
1717
describe('GenerateViewConfigJs', () => {
1818
Object.keys(fixtures)
1919
.sort()
20+
.filter(fixtureName => fixtureName !== 'OBJECT_PROPS')
2021
.forEach(fixtureName => {
2122
const fixture = fixtures[fixtureName];
2223

packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateComponentDescriptorH-test.js.snap

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,32 @@ using NoPropsNoEventsComponentComponentDescriptor = ConcreteComponentDescriptor<
390390
}
391391
`;
392392

393+
exports[`GenerateComponentDescriptorH can generate fixture OBJECT_PROPS 1`] = `
394+
Map {
395+
"ComponentDescriptors.h" => "
396+
/**
397+
* Copyright (c) Facebook, Inc. and its affiliates.
398+
*
399+
* This source code is licensed under the MIT license found in the
400+
* LICENSE file in the root directory of this source tree.
401+
*/
402+
403+
#pragma once
404+
405+
#include <react/components/OBJECT_PROPS/ShadowNodes.h>
406+
#include <react/core/ConcreteComponentDescriptor.h>
407+
408+
namespace facebook {
409+
namespace react {
410+
411+
using ObjectPropsComponentDescriptor = ConcreteComponentDescriptor<ObjectPropsShadowNode>;
412+
413+
} // namespace react
414+
} // namespace facebook
415+
",
416+
}
417+
`;
418+
393419
exports[`GenerateComponentDescriptorH can generate fixture POINT_PROP 1`] = `
394420
Map {
395421
"ComponentDescriptors.h" => "

packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateComponentHObjCpp-test.js.snap

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,29 @@ NS_ASSUME_NONNULL_END",
444444
}
445445
`;
446446
447+
exports[`GenerateComponentHObjCpp can generate fixture OBJECT_PROPS 1`] = `
448+
Map {
449+
"RCTComponentViewHelpers.h" => "/**
450+
* Copyright (c) Facebook, Inc. and its affiliates.
451+
*
452+
* This source code is licensed under the MIT license found in the
453+
* LICENSE file in the root directory of this source tree.
454+
*/
455+
456+
#import <Foundation/Foundation.h>
457+
#import <React/RCTDefines.h>
458+
#import <React/RCTLog.h>
459+
460+
NS_ASSUME_NONNULL_BEGIN
461+
462+
@protocol RCTObjectPropsViewProtocol <NSObject>
463+
464+
@end
465+
466+
NS_ASSUME_NONNULL_END",
467+
}
468+
`;
469+
447470
exports[`GenerateComponentHObjCpp can generate fixture POINT_PROP 1`] = `
448471
Map {
449472
"RCTComponentViewHelpers.h" => "/**

packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateEventEmitterCpp-test.js.snap

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,29 @@ namespace react {
402402
403403
404404
405+
} // namespace react
406+
} // namespace facebook
407+
",
408+
}
409+
`;
410+
411+
exports[`GenerateEventEmitterCpp can generate fixture OBJECT_PROPS 1`] = `
412+
Map {
413+
"EventEmitters.cpp" => "
414+
/**
415+
* Copyright (c) Facebook, Inc. and its affiliates.
416+
*
417+
* This source code is licensed under the MIT license found in the
418+
* LICENSE file in the root directory of this source tree.
419+
*/
420+
421+
#include <react/components/OBJECT_PROPS/EventEmitters.h>
422+
423+
namespace facebook {
424+
namespace react {
425+
426+
427+
405428
} // namespace react
406429
} // namespace facebook
407430
",

packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GenerateEventEmitterH-test.js.snap

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,30 @@ namespace react {
435435
436436
437437
438+
} // namespace react
439+
} // namespace facebook
440+
",
441+
}
442+
`;
443+
444+
exports[`GenerateEventEmitterH can generate fixture OBJECT_PROPS 1`] = `
445+
Map {
446+
"EventEmitters.h" => "
447+
/**
448+
* Copyright (c) Facebook, Inc. and its affiliates.
449+
*
450+
* This source code is licensed under the MIT license found in the
451+
* LICENSE file in the root directory of this source tree.
452+
*/
453+
#pragma once
454+
455+
#include <react/components/view/ViewEventEmitter.h>
456+
457+
namespace facebook {
458+
namespace react {
459+
460+
461+
438462
} // namespace react
439463
} // namespace facebook
440464
",

0 commit comments

Comments
 (0)