UNPKG

react-native-scrollable-calendar-strip

Version:
42 lines (34 loc) 1.05 kB
import React from "react"; import Enzyme, { shallow } from "enzyme"; import Adapter from 'enzyme-adapter-react-16'; import moment from "moment"; import CalendarHeader from "../src/CalendarHeader"; Enzyme.configure({ adapter: new Adapter() }); const today = moment(); describe("CalendarHeader Component", () => { it("should render without issues", () => { const component = shallow( <CalendarHeader calendarHeaderFormat="MMMM YYYY" weekStartDate={today} weekEndDate={today.clone().add(1, "week")} fontSize={20} allowHeaderTextScaling={true} /> ); expect(component).toBeTruthy(); }); it("should render custom header without issues", () => { const component = shallow( <CalendarHeader calendarHeaderFormat="MMMM YYYY" weekStartDate={today} weekEndDate={today.clone().add(1, "week")} fontSize={20} allowHeaderTextScaling={true} headerText={"Custom Header"} /> ); expect(component).toBeTruthy(); }); });