2015-03-23 20:28:42 +00:00
|
|
|
/**
|
2017-05-06 03:50:47 +00:00
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
* All rights reserved.
|
2015-03-23 20:28:42 +00:00
|
|
|
*
|
2017-05-06 03:50:47 +00:00
|
|
|
* This source code is licensed under the BSD-style license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
2015-03-28 05:18:47 +00:00
|
|
|
*
|
2015-03-23 20:28:42 +00:00
|
|
|
*/
|
2015-03-10 21:06:09 +00:00
|
|
|
|
|
|
|
#import <UIKit/UIKit.h>
|
|
|
|
#import <XCTest/XCTest.h>
|
|
|
|
|
2015-03-25 05:07:16 +00:00
|
|
|
#import <RCTTest/RCTTestRunner.h>
|
|
|
|
|
2017-05-06 03:50:47 +00:00
|
|
|
@interface RNTesterSnapshotTests : XCTestCase
|
2015-03-25 05:07:16 +00:00
|
|
|
{
|
|
|
|
RCTTestRunner *_runner;
|
|
|
|
}
|
2015-03-10 21:06:09 +00:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
2017-05-06 03:50:47 +00:00
|
|
|
@implementation RNTesterSnapshotTests
|
2015-03-10 21:06:09 +00:00
|
|
|
|
2015-03-25 05:07:16 +00:00
|
|
|
- (void)setUp
|
|
|
|
{
|
2017-05-06 03:50:47 +00:00
|
|
|
_runner = RCTInitRunnerForApp(@"RNTester/js/RNTesterApp.ios", nil);
|
2016-08-17 17:37:01 +00:00
|
|
|
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 10) {
|
|
|
|
_runner.testSuffix = @"-iOS10";
|
|
|
|
}
|
2015-07-07 23:19:40 +00:00
|
|
|
_runner.recordMode = NO;
|
2015-03-10 21:06:09 +00:00
|
|
|
}
|
|
|
|
|
2015-07-07 23:19:40 +00:00
|
|
|
#define RCT_TEST(name) \
|
|
|
|
- (void)test##name \
|
|
|
|
{ \
|
|
|
|
[_runner runTest:_cmd module:@#name]; \
|
2015-03-25 05:07:16 +00:00
|
|
|
}
|
|
|
|
|
2015-07-07 23:19:40 +00:00
|
|
|
RCT_TEST(ViewExample)
|
|
|
|
RCT_TEST(LayoutExample)
|
2017-02-07 04:58:23 +00:00
|
|
|
RCT_TEST(ScrollViewExample)
|
2015-07-07 23:19:40 +00:00
|
|
|
RCT_TEST(TextExample)
|
2016-12-19 14:26:07 +00:00
|
|
|
#if !TARGET_OS_TV
|
|
|
|
// No switch or slider available on tvOS
|
2015-07-07 23:19:40 +00:00
|
|
|
RCT_TEST(SwitchExample)
|
2016-08-17 17:37:01 +00:00
|
|
|
RCT_TEST(SliderExample)
|
2016-12-19 14:26:07 +00:00
|
|
|
// TabBarExample on tvOS passes locally but not on Travis
|
2016-08-17 17:37:01 +00:00
|
|
|
RCT_TEST(TabBarExample)
|
2016-10-05 14:15:25 +00:00
|
|
|
#endif
|
2015-07-07 23:19:40 +00:00
|
|
|
|
|
|
|
- (void)testZZZNotInRecordMode
|
|
|
|
{
|
|
|
|
XCTAssertFalse(_runner.recordMode, @"Don't forget to turn record mode back to off");
|
|
|
|
}
|
2015-03-25 05:07:16 +00:00
|
|
|
|
2015-03-10 21:06:09 +00:00
|
|
|
@end
|