UNPKG

@kiwicom/smart-faq

Version:

Smart FAQ

43 lines (38 loc) 1.14 kB
"use strict"; var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); var React = _interopRequireWildcard(require("react")); var _enzyme = require("enzyme"); var _BookingCardsList = require("../BookingCardsList"); // @flow var mockRefType /*: any*/ = null; describe('RawBookingCardsList', function () { it('no bookings in list', function () { var bookings = []; var result = (0, _enzyme.shallow)(React.createElement(_BookingCardsList.RawBookingCardsList, { title: "Example", bookings: bookings, loadMore: jest.fn(), isLoading: false, hasMore: false })); expect(result).toMatchSnapshot(); }); it('bookings in list', function () { var bookings = [{ $refType: mockRefType, $fragmentRefs: mockRefType, databaseId: '123456', type: 'BookingOneWay' }]; var result = (0, _enzyme.shallow)(React.createElement(_BookingCardsList.RawBookingCardsList, { title: "Example", bookings: bookings, loadMore: jest.fn(), isLoading: false, hasMore: true })); expect(result).toMatchSnapshot(); }); });