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