mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-29 12:55:21 +08:00
16 lines
549 B
JavaScript
16 lines
549 B
JavaScript
import * as React from 'react';
|
|
import { View } from 'react-native';
|
|
import renderer from 'react-test-renderer';
|
|
import withOrientation, { isOrientationLandscape } from '../withOrientation';
|
|
|
|
it('adds isLandscape to props', () => {
|
|
const WrappedComponent = withOrientation(View);
|
|
const rendered = renderer.create(<WrappedComponent />).toJSON();
|
|
expect(rendered).toMatchSnapshot();
|
|
});
|
|
|
|
it('calculates orientation correctly', () => {
|
|
const isLandscape = isOrientationLandscape({ width: 10, height: 1 });
|
|
expect(isLandscape).toBe(true);
|
|
});
|