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