@applicaster/zapp-react-native-utils
Version:
Applicaster Zapp React Native utilities package
34 lines (27 loc) • 1.17 kB
text/typescript
import { isFirstComponentScreenPicker } from "..";
describe("isFirstComponentScreenPicker", () => {
it("should return true if the first component screen-picker", () => {
const items = [{ component_type: "screen-picker-qb-tv" }];
expect(isFirstComponentScreenPicker(items)).toBe(true);
});
it("should return false if the first component type is not screen-picker", () => {
const items = [{ component_type: "other-component" }];
expect(isFirstComponentScreenPicker(items)).toBe(false);
});
it("should return false if the component type is undefined", () => {
const items = [{ component_type: undefined }];
expect(isFirstComponentScreenPicker(items)).toBe(false);
});
it("should return false if the item is null", () => {
const items = null;
expect(isFirstComponentScreenPicker(items)).toBe(false);
});
it("should return false if the item is undefined", () => {
const items = undefined;
expect(isFirstComponentScreenPicker(items)).toBe(false);
});
it("should return false if the item is an empty object", () => {
const items = {};
expect(isFirstComponentScreenPicker(items)).toBe(false);
});
});