UNPKG

@applicaster/zapp-react-native-ui-components

Version:

Applicaster Zapp React Native ui components for the Quick Brick App

54 lines (44 loc) 1.48 kB
import { ORIENTATIONS } from "@applicaster/zapp-react-native-utils/appUtils/orientationHelper"; import { orientationWasChangedFromPortraitToLandscape } from ".."; describe("orientationWasChangedFromPortraitToLandscape", () => { it("return true for from=portrait and to=landscape", () => { const fromOrientation = ORIENTATIONS.portrait; const toOrientation = ORIENTATIONS.landscapeSensor; expect( orientationWasChangedFromPortraitToLandscape({ fromOrientation, toOrientation, }) ).toBe(true); }); it("return false for from=landscape to=portrait", () => { const fromOrientation = ORIENTATIONS.landscapeLeft; const toOrientation = ORIENTATIONS.portrait; expect( orientationWasChangedFromPortraitToLandscape({ fromOrientation, toOrientation, }) ).toBe(false); }); it("return true for from=unknown to=landscape ", () => { const fromOrientation = ORIENTATIONS.unknown; const toOrientation = ORIENTATIONS.landscapeRight; expect( orientationWasChangedFromPortraitToLandscape({ fromOrientation, toOrientation, }) ).toBe(true); }); it("return false for from=unknown to=portrait", () => { const fromOrientation = ORIENTATIONS.unknown; const toOrientation = ORIENTATIONS.portrait; expect( orientationWasChangedFromPortraitToLandscape({ fromOrientation, toOrientation, }) ).toBe(false); }); });