2016-04-25 23:31:29 +00:00
|
|
|
/**
|
2018-09-11 22:27:47 +00:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2016-04-25 23:31:29 +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.
|
2017-11-02 13:14:11 +00:00
|
|
|
*
|
2018-05-11 02:06:46 +00:00
|
|
|
* @format
|
2017-11-02 13:14:11 +00:00
|
|
|
* @emails oncall+react_native
|
2016-04-25 23:31:29 +00:00
|
|
|
*/
|
2018-05-11 02:06:46 +00:00
|
|
|
|
2016-04-25 23:31:29 +00:00
|
|
|
'use strict';
|
|
|
|
|
2018-05-10 22:44:52 +00:00
|
|
|
const PlatformIOS = require('../Platform.ios');
|
|
|
|
const PlatformAndroid = require('../Platform.android');
|
2016-04-25 23:31:29 +00:00
|
|
|
|
|
|
|
describe('Platform', () => {
|
|
|
|
describe('OS', () => {
|
|
|
|
it('should have correct value', () => {
|
|
|
|
expect(PlatformIOS.OS).toEqual('ios');
|
|
|
|
expect(PlatformAndroid.OS).toEqual('android');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('select', () => {
|
|
|
|
it('should return platform specific value', () => {
|
2018-05-11 02:06:46 +00:00
|
|
|
const obj = {ios: 'ios', android: 'android'};
|
2016-04-25 23:31:29 +00:00
|
|
|
expect(PlatformIOS.select(obj)).toEqual(obj.ios);
|
|
|
|
expect(PlatformAndroid.select(obj)).toEqual(obj.android);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|