2015-03-23 13:28:42 -07:00
|
|
|
/**
|
2017-05-05 20:50:47 -07:00
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
2015-03-23 13:28:42 -07:00
|
|
|
*
|
2018-02-16 18:24:55 -08: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-27 22:18:47 -07:00
|
|
|
*
|
2015-03-23 13:28:42 -07:00
|
|
|
*/
|
2015-03-10 14:06:09 -07:00
|
|
|
|
|
|
|
#import <UIKit/UIKit.h>
|
|
|
|
#import <XCTest/XCTest.h>
|
|
|
|
|
2015-03-24 22:07:16 -07:00
|
|
|
#import <RCTTest/RCTTestRunner.h>
|
|
|
|
|
2017-05-05 20:50:47 -07:00
|
|
|
@interface RNTesterSnapshotTests : XCTestCase
|
2015-03-24 22:07:16 -07:00
|
|
|
{
|
|
|
|
RCTTestRunner *_runner;
|
|
|
|
}
|
2015-03-10 14:06:09 -07:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
2017-05-05 20:50:47 -07:00
|
|
|
@implementation RNTesterSnapshotTests
|
2015-03-10 14:06:09 -07:00
|
|
|
|
2015-03-24 22:07:16 -07:00
|
|
|
- (void)setUp
|
|
|
|
{
|
2017-11-12 13:30:13 -08:00
|
|
|
_runner = RCTInitRunnerForApp(@"RNTester/js/RNTesterApp.ios", nil, nil);
|
2017-09-21 12:27:37 -07:00
|
|
|
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 11) {
|
|
|
|
_runner.testSuffix = @"-iOS11";
|
|
|
|
} else if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 10) {
|
2016-08-17 10:37:01 -07:00
|
|
|
_runner.testSuffix = @"-iOS10";
|
|
|
|
}
|
2015-07-07 16:19:40 -07:00
|
|
|
_runner.recordMode = NO;
|
2015-03-10 14:06:09 -07:00
|
|
|
}
|
|
|
|
|
2015-07-07 16:19:40 -07:00
|
|
|
#define RCT_TEST(name) \
|
|
|
|
- (void)test##name \
|
|
|
|
{ \
|
|
|
|
[_runner runTest:_cmd module:@#name]; \
|
2015-03-24 22:07:16 -07:00
|
|
|
}
|
|
|
|
|
2015-07-07 16:19:40 -07:00
|
|
|
RCT_TEST(ViewExample)
|
|
|
|
RCT_TEST(LayoutExample)
|
2017-05-25 08:37:55 -07:00
|
|
|
RCT_TEST(ARTExample)
|
2017-02-06 20:58:23 -08:00
|
|
|
RCT_TEST(ScrollViewExample)
|
2015-07-07 16:19:40 -07:00
|
|
|
RCT_TEST(TextExample)
|
2016-12-19 06:26:07 -08:00
|
|
|
#if !TARGET_OS_TV
|
|
|
|
// No switch or slider available on tvOS
|
2015-07-07 16:19:40 -07:00
|
|
|
RCT_TEST(SwitchExample)
|
2016-08-17 10:37:01 -07:00
|
|
|
RCT_TEST(SliderExample)
|
|
|
|
RCT_TEST(TabBarExample)
|
2016-10-05 07:15:25 -07:00
|
|
|
#endif
|
2015-07-07 16:19:40 -07:00
|
|
|
|
|
|
|
- (void)testZZZNotInRecordMode
|
|
|
|
{
|
|
|
|
XCTAssertFalse(_runner.recordMode, @"Don't forget to turn record mode back to off");
|
|
|
|
}
|
2015-03-24 22:07:16 -07:00
|
|
|
|
2015-03-10 14:06:09 -07:00
|
|
|
@end
|