2015-03-23 20:28:42 +00:00
|
|
|
/**
|
2017-05-06 03:50:47 +00:00
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
2015-03-23 20:28:42 +00:00
|
|
|
*
|
2018-02-17 02:24:55 +00:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
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-11-12 21:30:13 +00:00
|
|
|
_runner = RCTInitRunnerForApp(@"RNTester/js/RNTesterApp.ios", nil, nil);
|
2017-09-21 19:27:37 +00:00
|
|
|
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 11) {
|
|
|
|
_runner.testSuffix = @"-iOS11";
|
|
|
|
} else if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 10) {
|
2016-08-17 17:37:01 +00:00
|
|
|
_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-05-25 15:37:55 +00:00
|
|
|
RCT_TEST(ARTExample)
|
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)
|
|
|
|
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
|