Files
react-native/ReactAndroid/src/androidTest/js/DatePickerDialogTestModule.js
T
Konstantin Raev 2c3ca4c058 Open sourced 4 more instrumentation tests for RN Android
Summary:
More instrumentation tests in OSS means less work for FB engineers to investigate if a PR breaks some internal tests.

+ increased timeouts and retries for OSS tests runner

Reviewed By: andreicoman11

Differential Revision: D3292582

fbshipit-source-id: 3f8aa4d3536450ea3af7acff044b9bb62be0f9db
2016-05-12 10:52:30 -07:00

48 lines
1.4 KiB
JavaScript

/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* 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.
*
* @providesModule DatePickerDialogTestModule
*/
'use strict';
var BatchedBridge = require('BatchedBridge');
var DatePickerAndroid = require('DatePickerAndroid');
var React = require('React');
var RecordingModule = require('NativeModules').DatePickerDialogRecordingModule;
var View = require('View');
var DatePickerDialogTestApp = React.createClass({
render: function() {
return (<View />);
},
});
var DatePickerDialogTestModule = {
DatePickerDialogTestApp: DatePickerDialogTestApp,
showDatePickerDialog: function(options) {
DatePickerAndroid.open(options).then(
({action, year, month, day}) => {
if (action === DatePickerAndroid.dateSetAction) {
RecordingModule.recordDate(year, month, day);
} else if (action === DatePickerAndroid.dismissedAction) {
RecordingModule.recordDismissed();
}
},
({code, message}) => RecordingModule.recordError()
);
},
};
BatchedBridge.registerCallableModule(
'DatePickerDialogTestModule',
DatePickerDialogTestModule
);
module.exports = DatePickerDialogTestModule;