Last active 1748323601

App.js Raw
1import "./App.css";
2import Games from "./pages/home";
3import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
4import React, { Component } from "react";
5import Booking from "./pages/book";
6import Search_Booking from "./pages/search_booking";
7class App extends Component {
8 state = {};
9 render() {
10 return (
11 <div>
12 <Router>
13 <div>
14 <Switch>
15 <Route exact path="/" component={Games} />
16 <Route exact path="/booking" component={Booking} />
17 <Route exact path="/search" component={Search_Booking} />
18 </Switch>
19 </div>
20 </Router>
21 </div>
22 );
23 }
24}
25
26export default App;
27
Read Only Raw
1## Read-only Files
2The following files are marked read-only. You cannot edit these files
3in the editor; however, it is possible from the terminal. You must not
4modify or delete these files because doing so results in a zero score.
5
6* Node/src/db/defaultDB.js
7* src/test/book.test.js
8* src/test/home.test.js
9* src/test/reducer.test.js
10* src/test/search.test.js
11* src/test/slot.test.js
action.js Raw
1Action/action.js
2
3export const selectGame = id => {
4 return {
5 type: "SELECT_GAME",
6 id
7 };
8};
9
10export const onSelectedDay = Day => {
11 return {
12 type: "ON_SELECTED_DAY",
13 Day
14 };
15};
16export const doneBooking = Day => {
17 return {
18 type: "DONE_BOOKING",
19 Day
20 };
21};
22export const iconClick = () => {
23 return {
24 type: "ICON_CLICK"
25 }
26}
27export const selectSlot = id => {
28 return {
29 type: "ON_SELECT_SLOT",
30 id
31 };
32};
33
34export const onCLICK = () => {
35 return {
36 type: "on_CLICK"
37 };
38};
39
40export const checkBooking = payload => {
41 return {
42 type: "CHECK_BOOKING",
43 payload
44 };
45};
46
book.js Raw
1pages/book.js
2
3import React, { Component } from "react";
4import DayPicker from "react-day-picker";
5import "react-day-picker/lib/style.css";
6import icon from "../images/football.svg";
7import { connect } from "react-redux";
8import { onSelectedDay, doneBooking, iconClick } from "../Action/action";
9
10export class Booking extends Component {
11 state = {
12 name: undefined,
13 contact: undefined,
14 errorStmt: "",
15 };
16
17 handleHomePage = () => {
18
19 };
20
21
22 handleValidation = () => {
23
24 };
25
26 Display_slot = Day => {
27 this.props.onSelectedDay(Day);
28 };
29
30
31 handleBook = () => {
32
33 };
34
35 render() {
36
37 return (
38 <div className="Home">
39 <header>
40 Play Zone:
41 <img
42 alt=""
43 id="icon"
44 src={icon}
45 onClick={this.handleHomePage}
46 width="40px"
47 height="40px"
48 />
49 <p id="header_Date">
50 {/* display date */}
51 </p>
52 </header>
53
54 <div className="Card" id="date">
55 {/* date picker goes here */}
56 </div>
57 <br />
58 <div>
59 <div id="slot-display">
60 {/* code goes here to display slot */}
61 <div>
62 {/* code goes here for the name and contact number input fields
63 each input field has name as name and contact respectively*/}
64
65 <div>
66 {/* code goes here the "Book Now" button with id book_button */}
67 {/* span to display error statement */}
68
69 </div>
70 </div>
71 </div>
72
73 <p id="not_opened">
74 Booking has been closed.Book your slot for
75 {/* code goes here to display the date */}
76 </p>
77
78 <p id="not_opened">Booking is not opened yet</p>
79
80 </div>
81 </div>
82 );
83 }
84}
85
86const mapStateToProps = state => {
87 return {
88 game: state.Games,
89 selectedGame: state.selectedGame,
90 selectedDate: state.selectedDate,
91 slotBooked: state.slotBooked
92 };
93};
94
95const mapDispatchToProps = dispatch => {
96 return {
97 doneBooking: () => dispatch(doneBooking()),
98 onSelectedDay: id => dispatch(onSelectedDay(id)),
99 iconClick: () => dispatch(iconClick()),
100 bookingDetails: (details, updatesGame) => dispatch({ type: "BOOKINGS", details, updatesGame }),
101 };
102};
103
104export default connect(
105 mapStateToProps,
106 mapDispatchToProps
107)(Booking);
108
book.test.js Raw
1test/book.test.js
2
3import React, { Component } from "react";
4import { Booking } from "../pages/book";
5import { shallow, mount } from "enzyme";
6import configureStore from "redux-mock-store";
7import { configure } from "enzyme";
8import Adapter from "enzyme-adapter-react-16";
9import BasketBall from "../images/basket_ball.jpeg";
10import VolleyBall from "../images/volleyBall.jpeg";
11import cricket from "../images/cricket_bat.jpg";
12import FootBall from "../images/football.jpeg";
13import {
14 bookSlot1,
15 bookSlot2,
16 bookSlot3,
17 bookSlot4
18} from "../Component/slot_data";
19import DayPicker from "react-day-picker";
20
21configure({ adapter: new Adapter() });
22
23const mockStore = configureStore([]);
24describe("Book page", () => {
25 const historyMock = { push: jest.fn() };
26 const mockfn1 = jest.fn();
27 const mockfn2 = jest.fn();
28 window.alert = jest.fn();
29 let store;
30 let component;
31 let error;
32 let Dates;
33 let Closed;
34
35 beforeEach(() => {
36 const Games1 = [
37 { id: 0, src: BasketBall, name: "BasketBall", slots: bookSlot1 },
38 { id: 1, src: VolleyBall, name: "VolleyBall", slots: bookSlot2 },
39 { id: 2, src: cricket, name: "Cricket", slots: bookSlot3 },
40 { id: 3, src: FootBall, name: "FootBall", slots: bookSlot4 }
41 ]
42 const selectedGame1 = [
43 { id: 1, src: VolleyBall, name: "VolleyBall", slots: bookSlot2 }
44 ]
45 const selectedDate1 = new Date(
46 new Date().getFullYear(),
47 new Date().getMonth(),
48 new Date().getDate() + 1
49 )
50 const slotBooked1 = undefined
51 component = shallow(
52 <Booking
53 game={Games1}
54 selectedGame={selectedGame1}
55 selectedDate={selectedDate1}
56 slotBooked={slotBooked1}
57 onSelectedDay={mockfn1}
58 bookingDetails={mockfn1}
59 iconClick={mockfn1}
60 history={historyMock}
61 doneBooking={mockfn1}
62 />
63 )
64
65 });
66 it("Book Content", () => {
67 const Date_display =
68 new Date().getDate() + 1 + "/" + (new Date().getMonth() + 1) + "/" + new Date().getFullYear();
69 expect(component.find("header").length).toBe(1);
70 expect(component.find("header").childAt(0).length).toBe(1);
71 expect(component.find("header").find("p").length).toBe(1);
72 expect(component.find("header").text()).toBe(
73 "Play Zone:Slot Date:" + Date_display
74 );
75 expect(component.find(".Card").length).toBe(1);
76 expect(component.find("#book_button")).toBeTruthy();
77 component
78 .find("header")
79 .find("img")
80 .simulate("click");
81 expect(historyMock.push.mock.calls[0]).toEqual(["/"]);
82 expect(component.find("#date").find(DayPicker).length).toBe(1);
83 });
84 it("input fields", () => {
85 expect(component.find("#contact").length).toBe(2);
86 component
87 .find("#contact")
88 .at(0)
89 .simulate("change", { target: { name: "name", value: "anu" } });
90 expect(component.state().name).toEqual("anu");
91 component
92 .find("#contact")
93 .at(1)
94 .simulate("change", { target: { name: "contact", value: "9890900001" } });
95 expect(component.state().contact).toEqual("9890900001");
96 component
97 .find("#contact")
98 .at(0)
99 .simulate("change", { target: { name: "name", value: "" } });
100 expect(component.state().name).toEqual("");
101 component
102 .find("#contact")
103 .at(1)
104 .simulate("change", { target: { name: "contact", value: "" } });
105 expect(component.state().contact).toEqual("");
106 });
107 it("err msg: select your slot", () => {
108 component.find("#book_button").simulate("Click");
109 expect(component.state().errorStmt).toEqual("Select your slot!!!");
110 component
111 .find("#contact")
112 .at(0)
113 .simulate("change", { target: { name: "name", value: "anu" } });
114 component
115 .find("#contact")
116 .at(1)
117 .simulate("change", { target: { name: "contact", value: "9890900001" } });
118 component.find("#book_button").simulate("Click");
119 expect(component.state().errorStmt).toEqual("Select your slot!!!");
120 });
121 it("err msg check your field", () => {
122 const Games2 = [
123 { id: 0, src: BasketBall, name: "BasketBall", slots: bookSlot1 },
124 { id: 1, src: VolleyBall, name: "VolleyBall", slots: bookSlot2 },
125 { id: 2, src: cricket, name: "Cricket", slots: bookSlot3 },
126 { id: 3, src: FootBall, name: "FootBall", slots: bookSlot4 }
127 ]
128 const selectedGame2 =
129 {
130 id: 1, src: VolleyBall, name: "VolleyBall", slots: [
131 { id: 3, startTime: "11.00 A.M", endTime: "12.00 P.M", slotStatus: "btn btn-primary" },
132 { id: 4, startTime: "12.00 P.M", endTime: "01.00 P.M", slotStatus: "btn btn-success" }
133 ]
134 }
135
136 const selectedDate2 = new Date(
137 new Date().getFullYear(),
138 new Date().getMonth(),
139 new Date().getDate() + 1
140 )
141 const slotBooked2 = [
142 { id: 3, startTime: "11.00 A.M", endTime: "12.00 P.M", slotStatus: "btn btn-success" }
143 ]
144 const wrapper = shallow(
145 <Booking
146 game={Games2}
147 selectedGame={selectedGame2}
148 selectedDate={selectedDate2}
149 slotBooked={slotBooked2}
150 onSelectedDay={mockfn1}
151 bookingDetails={mockfn2}
152 iconClick={mockfn1}
153 history={historyMock}
154 doneBooking={mockfn1}
155 />
156 )
157
158 wrapper.find("#book_button").simulate("Click");
159 expect(wrapper.state().errorStmt).toEqual("Invalid Input!!!");
160 wrapper
161 .find("#contact")
162 .at(0)
163 .simulate("change", { target: { name: "name", value: "anu" } });
164 wrapper.find("#book_button").simulate("Click");
165 expect(wrapper.state().errorStmt).toEqual("Invalid Input!!!");
166 wrapper
167 .find("#contact")
168 .at(1)
169 .simulate("change", { target: { name: "contact", value: "9890" } });
170 wrapper.find("#book_button").simulate("Click");
171 expect(wrapper.state().errorStmt).toEqual("Invalid Input!!!");
172 wrapper
173 .find("#contact")
174 .at(0)
175 .simulate("change", { target: { name: "name", value: "987" } });
176 wrapper
177 .find("#contact")
178 .at(0)
179 .simulate("change", { target: { name: "contact", value: "9890980908" } });
180 wrapper.find("#book_button").simulate("Click");
181 expect(wrapper.state().errorStmt).toEqual("Invalid Input!!!");
182 wrapper
183 .find("#contact")
184 .at(0)
185 .simulate("change", { target: { name: "name", value: "anu" } });
186 wrapper
187 .find("#contact")
188 .at(1)
189 .simulate("change", { target: { name: "contact", value: "9890980908" } });
190 wrapper.find("#book_button").simulate("Click");
191 expect(wrapper.state().errorStmt).toEqual("");
192 expect(mockfn1).toHaveBeenCalled();
193 expect(window.alert).toHaveBeenCalled();
194 });
195
196 it("Display slot", () => {
197 expect(component.find("Connect(Slots)").length).toBe(1);
198 });
199 it("Booking not opened", () => {
200 const Games3 = [
201 { id: 0, src: BasketBall, name: "BasketBall", slots: bookSlot1 },
202 { id: 1, src: VolleyBall, name: "VolleyBall", slots: bookSlot2 },
203 { id: 2, src: cricket, name: "Cricket", slots: bookSlot3 },
204 { id: 3, src: FootBall, name: "FootBall", slots: bookSlot4 }
205 ]
206 const selectedGame3 = [
207 { id: 1, src: VolleyBall, name: "VolleyBall", slots: bookSlot2 }
208 ]
209 const selectedDate3 = new Date(
210 new Date().getFullYear(),
211 new Date().getMonth(),
212 new Date().getDate() + 2
213 )
214 const slotBooked3 = undefined
215 const wrapper = shallow(
216 <Booking
217 game={Games3}
218 selectedGame={selectedGame3}
219 selectedDate={selectedDate3}
220 slotBooked={slotBooked3}
221 onSelectedDay={mockfn1}
222 bookingDetails={mockfn1}
223 iconClick={mockfn1}
224 history={historyMock}
225 doneBooking={mockfn1}
226 />)
227 expect(wrapper.find("#not_opened").text()).toBe(
228 "Booking is not opened yet"
229 );
230 expect(wrapper.find("Slots").length).toBe(0);
231 expect(component.find("#date").find(DayPicker).length).toBe(1);
232 expect(wrapper.find("#book_button").length).toBe(0);
233 });
234 it("Booking Closed", () => {
235 const Games1 = [
236 { id: 0, src: BasketBall, name: "BasketBall", slots: bookSlot1 },
237 { id: 1, src: VolleyBall, name: "VolleyBall", slots: bookSlot2 },
238 { id: 2, src: cricket, name: "Cricket", slots: bookSlot3 },
239 { id: 3, src: FootBall, name: "FootBall", slots: bookSlot4 }
240 ]
241 const selectedGame1 = [
242 { id: 1, src: VolleyBall, name: "VolleyBall", slots: bookSlot2 }
243 ]
244 const selectedDate1 = new Date(
245 new Date().getFullYear(),
246 new Date().getMonth(),
247 new Date().getDate()
248 )
249 const slotBooked1 = undefined
250 const Date_display = new Date().getDate() + 1 + "/" + (new Date().getMonth() + 1) + "/" + new Date().getFullYear();
251 const wrapper = shallow(
252 <Booking
253 game={Games1}
254 selectedGame={selectedGame1}
255 selectedDate={selectedDate1}
256 slotBooked={slotBooked1}
257 onSelectedDay={mockfn1}
258 bookingDetails={mockfn1}
259 iconClick={mockfn1}
260 history={historyMock}
261 doneBooking={mockfn1}
262 />
263 )
264
265 expect(
266 wrapper
267 .find("#not_opened")
268 .render()
269 .text()
270 ).toBe("Booking has been closed. Book your slot for" + Date_display);
271 expect(wrapper.find("Slots").length).toBe(0);
272 expect(wrapper.find("#date").find(DayPicker).length).toBe(1);
273 expect(wrapper.find("#book_button").length).toBe(0);
274 });
275});
276
home.js Raw
1pages/home.js
2
3import React, { Component } from "react";
4import "../App.css";
5import "bootstrap/dist/css/bootstrap.css";
6import { selectGame } from "../Action/action";
7import { connect } from "react-redux";
8
9export class Games extends Component {
10
11 handlebook = i => {
12
13 };
14
15 handleSearch = () => {
16
17 };
18
19 render() {
20
21 // Template to display each game
22
23 // <div className="Card" key={game.id}>
24 // <ul>
25 // <li>
26 // <img hieght="300px" width="200px"></img>
27 // </li>
28 // <li></li>
29 // <li>
30 // <button
31 // className="btn btn-dark "
32 // >
33 // Book Now
34 // </button>
35 // </li>
36 // </ul>
37 // </div>
38
39 return (
40 <div className="Home">
41 <header>
42 {/* code goes here to display the title and and an image */}
43 </header>
44 <center>
45 {/* code goes here to loop the each game */}
46 </center>
47 <center>
48 <div>
49 <button
50 className=" btn-lg btn btn-dark m-2"
51 >
52
53 </button>
54 </div>
55 </center>
56 </div>
57 );
58 }
59}
60const mapStateToProps = state => {
61 return {
62 Games: state.Games
63 };
64};
65const mapDispatchToProps = dispatch => {
66 return {
67
68 postDate: (date) => dispatch({ type: "TODAY_DATE", date }),
69 selectGame: id => dispatch(selectGame(id)),
70 getGameAndBooking: () => dispatch({ type: "GAME_BOOKING" })
71 };
72};
73
74export default connect(
75 mapStateToProps,
76 mapDispatchToProps
77)(Games);
78
home.test.js Raw
1home.test.js
2
3import React from "react";
4import { Games } from "../pages/home";
5import { shallow } from "enzyme";
6import configureStore from "redux-mock-store";
7import { configure } from "enzyme";
8import Adapter from "enzyme-adapter-react-16";
9import BasketBall from "../images/basket_ball.jpeg";
10import VolleyBall from "../images/volleyBall.jpeg";
11import cricket from "../images/cricket_bat.jpg";
12import FootBall from "../images/football.jpeg";
13import {
14 bookSlot1,
15 bookSlot2,
16 bookSlot3,
17 bookSlot4
18} from "../Component/slot_data";
19
20configure({ adapter: new Adapter() });
21
22const mockStore = configureStore([]);
23describe("Home component", () => {
24 const historyMock = { push: jest.fn() };
25 const mockfn1 = jest.fn();
26 const mockfn2 = jest.fn();
27 const mockfn3 = jest.fn();
28 let store;
29 let component;
30 afterEach(() => {
31 jest.clearAllMocks();
32 })
33 beforeEach(() => {
34 const Games1 = [
35 { id: 0, src: BasketBall, name: "BasketBall", slots: bookSlot1 },
36 { id: 1, src: VolleyBall, name: "VolleyBall", slots: bookSlot2 },
37 { id: 2, src: cricket, name: "Cricket", slots: bookSlot3 },
38 { id: 3, src: FootBall, name: "FootBall", slots: bookSlot4 }
39 ]
40 component = shallow(
41 <Games
42 Games={Games1}
43 selectGame={mockfn3}
44 getGameAndBooking={mockfn1}
45 history={historyMock}
46 postDate={mockfn2}
47 />
48 )
49
50 });
51 it("DidMount", () => {
52 expect(mockfn1).toHaveBeenCalledTimes(1);
53 expect(mockfn2).toHaveBeenCalledTimes(1);
54 })
55 it("play zone content", () => {
56 expect(component.find("header").length).toBe(1);
57 expect(component.find("header").text()).toEqual("Play Zone ");
58 expect(component.find(".Card").length).toBe(4);
59 const align = component
60 .find("center")
61 .at(1)
62 .find("div")
63 .find("button");
64 expect(align.render().text()).toBe("Check your booking");
65 expect(component.find("header").childAt(0).length).toBe(1);
66 });
67 it("card content", () => {
68 const Cards = component.find(".Card");
69 const Product = Cards.find("ul").map(child => child.text());
70 expect(Product).toEqual([
71 "BasketBallBook Now",
72 "VolleyBallBook Now",
73 "CricketBook Now",
74 "FootBallBook Now"
75 ]);
76 });
77 it("BookNow Click", () => {
78 const spy = jest.spyOn(component.instance(), "handlebook");
79 const BookNow_Btn = component
80 .find("center")
81 .at(0)
82 .find("div")
83 .find("button")
84 .at(1);
85 BookNow_Btn.simulate("click");
86 expect(spy).toHaveBeenCalled();
87 expect(mockfn3).toHaveBeenCalledTimes(1);
88 });
89 it("On Clicking Book Now", () => {
90 const spy = jest.spyOn(component.instance(), "handleSearch");
91 const check_btn = component
92 .find("center")
93 .at(1)
94 .find("div")
95 .find("button");
96 check_btn.simulate("click");
97 expect(spy).toHaveBeenCalled();
98 });
99});
100
101
index.js Raw
1sagas/index.js
2
3import { takeEvery, put, call } from "redux-saga/effects";
4import axios from "axios";
5
6function* bookingAsync(action) {
7
8}
9function* getGameAndBookingAsync() {
10
11}
12function* postTodayTime(action) {
13
14}
15
16export function* watchBooking() {
17 yield takeEvery("BOOKINGS", bookingAsync);
18}
19export function* watchUpdateGame() {
20 yield takeEvery("GAME_BOOKING", getGameAndBookingAsync);
21}
22export function* watchPostTodayTime() {
23 yield takeEvery("TODAY_DATE", postTodayTime);
24}
25
reducer.js Raw
1const initState = {
2
3};
4
5const bookNowReducer = (state = initState, action) => {
6 switch (action.type) {
7 case "DONE_BOOKING": {
8
9 }
10 case "UPDATE_BOOKING": {
11
12 }
13 case "SELECT_GAME": {
14
15 }
16 case "ICON_CLICK": {
17
18 }
19 case "ON_SELECTED_DAY": {
20
21 }
22 case "ON_SELECT_SLOT": {
23
24 }
25
26 case "CHECK_BOOKING": {
27
28 }
29 default:
30 return state;
31 }
32};
33export default bookNowReducer;
34
reducer.test.js Raw
1test/reducer.test.js
2
3import bookNowReducer from "../Reducer/reducer";
4import BasketBall from "../images/basket_ball.jpeg";
5import VolleyBall from "../images/volleyBall.jpeg";
6import { bookSlot1, bookSlot2 } from "../Component/slot_data";
7
8describe("testing cart reducer", () => {
9 const initState = {
10 Games: [],
11 selectedGame: [],
12 selectedDate: new Date(
13 new Date().getFullYear(),
14 new Date().getMonth(),
15 new Date().getDate() + 1
16 ),
17
18 slotBooked: undefined,
19 details: [],
20 bookingCheck: []
21 };
22 it("initial state check", () => {
23 expect(bookNowReducer(undefined, {})).toEqual(initState);
24 });
25 it("UPDATE_BOOKING", () => {
26 const state = {
27 Games: [],
28 details: []
29 }
30 expect(bookNowReducer(state, {
31 type: "UPDATE_BOOKING",
32 GameAndSlot: [
33 { id: 0, src: BasketBall, name: "BasketBall", slots: bookSlot1 },
34 { id: 1, src: VolleyBall, name: "VolleyBall", slots: bookSlot2 }
35 ],
36 BookingDetail: [
37 {
38 bookingId: "14440074", contact: "9876443111", game: "BasketBall", name: "Roger", slotDate: "6/12/2020",
39 slot: { id: 4, startTime: "12.00 P.M", endTime: "01.00 P.M", slotStatus: "btn btn-success" }
40 },
41 {
42 bookingId: "92303869", contact: "9867844311", game: "FootBall", name: "shelly", slotDate: "6/12/2020",
43 slot: { id: 3, startTime: "11.00 A.M", endTime: "12.00 P.M", slotStatus: "btn btn-success" }
44 }
45 ]
46 })).toEqual({
47 Games: [
48 { id: 0, src: BasketBall, name: "BasketBall", slots: bookSlot1 },
49 { id: 1, src: VolleyBall, name: "VolleyBall", slots: bookSlot2 }
50 ],
51 details: [
52 {
53 bookingId: "14440074", contact: "9876443111", game: "BasketBall", name: "Roger", slotDate: "6/12/2020",
54 slot: { id: 4, startTime: "12.00 P.M", endTime: "01.00 P.M", slotStatus: "btn btn-success" }
55 },
56 {
57 bookingId: "92303869", contact: "9867844311", game: "FootBall", name: "shelly", slotDate: "6/12/2020",
58 slot: { id: 3, startTime: "11.00 A.M", endTime: "12.00 P.M", slotStatus: "btn btn-success" }
59 }
60 ]
61 });
62 });
63 it("select game(onBook)", () => {
64 const state = {
65 Games: [
66 { id: 0, src: BasketBall, name: "BasketBall", slots: bookSlot1 },
67 { id: 1, src: VolleyBall, name: "VolleyBall", slots: bookSlot2 }
68 ],
69 selectedGame: []
70 };
71 expect(bookNowReducer(state, { type: "SELECT_GAME", id: 1 })).toEqual({
72 Games: [
73 { id: 0, src: BasketBall, name: "BasketBall", slots: bookSlot1 },
74 { id: 1, src: VolleyBall, name: "VolleyBall", slots: bookSlot2 }
75 ],
76 selectedGame: { id: 1, src: VolleyBall, name: "VolleyBall", slots: bookSlot2 }
77 });
78 const next_state = {
79 Games: [
80 { id: 0, src: BasketBall, name: "BasketBall", slots: bookSlot1 },
81 {
82 id: 1, src: VolleyBall, name: "VolleyBall", slots: [
83 { id: 1, startTime: "09.00 A.M", endTime: "10.00 A.M", slotStatus: "btn btn-primary" },
84 { id: 2, startTime: "10.00 A.M", endTime: "11.00 A.M", slotStatus: "btn btn-success" },
85 { id: 3, startTime: "12.00 P.M", endTime: "01.00 P.M", slotStatus: "btn btn-danger" }
86 ]
87 }
88 ],
89 selectedGame: []
90 };
91 expect(bookNowReducer(next_state, { type: "SELECT_GAME", id: 1 })).toEqual({
92 Games: [
93 { id: 0, src: BasketBall, name: "BasketBall", slots: bookSlot1 },
94 {
95 id: 1, src: VolleyBall, name: "VolleyBall",
96 slots: [
97 { id: 1, startTime: "09.00 A.M", endTime: "10.00 A.M", slotStatus: "btn btn-success" },
98 { id: 2, startTime: "10.00 A.M", endTime: "11.00 A.M", slotStatus: "btn btn-success" },
99 { id: 3, startTime: "12.00 P.M", endTime: "01.00 P.M", slotStatus: "btn btn-danger" }
100 ]
101 }
102 ],
103 selectedGame: {
104 id: 1, src: VolleyBall, name: "VolleyBall",
105 slots: [
106 { id: 1, startTime: "09.00 A.M", endTime: "10.00 A.M", slotStatus: "btn btn-success" },
107 { id: 2, startTime: "10.00 A.M", endTime: "11.00 A.M", slotStatus: "btn btn-success" },
108 { id: 3, startTime: "12.00 P.M", endTime: "01.00 P.M", slotStatus: "btn btn-danger" }
109 ]
110 }
111 });
112 });
113 // .....
114
115 it("onShow", () => {
116 const state = {
117 selectedDate: new Date(
118 new Date().getFullYear(),
119 new Date().getMonth(),
120 new Date().getDate() + 1
121 )
122 };
123 expect(
124 bookNowReducer(state, {
125 type: "ON_SELECTED_DAY",
126 Day: "Wed Mar 11 2020 12:00:00 GMT+0530 (India Standard Time)"
127 })
128 ).toEqual({
129 selectedDate: "Wed Mar 11 2020 12:00:00 GMT+0530 (India Standard Time)"
130 });
131 });
132 it("on select slot", () => {
133 const state = {
134 selectedGame: { id: 1, src: VolleyBall, name: "VolleyBall", slots: bookSlot2 },
135 slotBooked: undefined
136 };
137 expect(bookNowReducer(state, { type: "ON_SELECT_SLOT", id: 2 })).toEqual({
138 selectedGame: { id: 1, src: VolleyBall, name: "VolleyBall", slots: bookSlot2 },
139 slotBooked: { id: 2, startTime: "10.00 A.M", endTime: "11.00 A.M", slotStatus: "btn btn-primary" }
140 });
141 expect(bookNowReducer(state, { type: "ON_SELECT_SLOT", id: 6 })).toEqual({
142 selectedGame: { id: 1, src: VolleyBall, name: "VolleyBall", slots: bookSlot2 },
143 slotBooked:
144 { id: 6, startTime: "02.00 P.M", endTime: "03.00 P.M", slotStatus: "btn btn-primary" }
145 });
146
147 const Nextstate = {
148 selectedGame: {
149 id: 1, src: VolleyBall, name: "VolleyBall",
150 slots: [
151 { id: 1, startTime: "09.00 A.M", endTime: "10.00 A.M", slotStatus: "btn btn-success" },
152 { id: 2, startTime: "10.00 A.M", endTime: "11.00 A.M", slotStatus: "btn btn-danger" }
153 ]
154 },
155 slotBooked: undefined
156
157 };
158 expect(bookNowReducer(Nextstate, { type: "ON_SELECT_SLOT", id: 2 })).toEqual({
159 selectedGame: {
160 id: 1, src: VolleyBall, name: "VolleyBall",
161 slots: [
162 { id: 1, startTime: "09.00 A.M", endTime: "10.00 A.M", slotStatus: "btn btn-success" },
163 { id: 2, startTime: "10.00 A.M", endTime: "11.00 A.M", slotStatus: "btn btn-danger" }
164 ]
165 },
166 slotBooked: undefined
167 });
168
169 });
170 it("DONE_BOOKING", () => {
171 const state = {
172 selectedGame: {
173 id: 1, src: VolleyBall, name: "VolleyBall",
174 slots: [
175 { id: 1, startTime: "09.00 A.M", endTime: "10.00 A.M", slotStatus: "btn btn-success" },
176 { id: 2, startTime: "10.00 A.M", endTime: "11.00 A.M", slotStatus: "btn btn-primary" }
177 ]
178 },
179 slotBooked: { id: 2, startTime: "10.00 A.M", endTime: "11.00 A.M", slotStatus: "btn btn-primary" }
180 };
181 expect(bookNowReducer(state, { type: "DONE_BOOKING" })).toEqual({
182 selectedGame: {
183 id: 1, src: VolleyBall, name: "VolleyBall",
184 slots: [
185 { id: 1, startTime: "09.00 A.M", endTime: "10.00 A.M", slotStatus: "btn btn-success" },
186 { id: 2, startTime: "10.00 A.M", endTime: "11.00 A.M", slotStatus: "btn btn-danger" }
187 ]
188 },
189 slotBooked: undefined
190 })
191 })
192 it("doneBooking", () => {
193 const state = {
194
195 slotBooked: { id: 2, startTime: "10.00 A.M", endTime: "11.00 A.M", slotStatus: "btn btn-primary" }
196 };
197 expect(bookNowReducer(state, { type: "ICON_CLICK", id: 2 })).toEqual({
198 slotBooked: undefined
199 })
200 })
201
202 it("check Booking", () => {
203 const state = {
204 bookingCheck: [],
205 details: [
206 {
207 bookingId: "14440074", contact: "9876443111", game: "BasketBall", name: "Roger", slotDate: "6/12/2020",
208 slot:
209 { id: 4, startTime: "12.00 P.M", endTime: "01.00 P.M", slotStatus: "btn btn-success" }
210 },
211 {
212 bookingId: "92303869",
213 contact: "9867844311",
214 game: "FootBall",
215 name: "shelly",
216 slotDate: "6/12/2020",
217 slot: { id: 3, startTime: "11.00 A.M", endTime: "12.00 P.M", slotStatus: "btn btn-success" }
218 }
219 ]
220 };
221 expect(
222 bookNowReducer(state, { type: "CHECK_BOOKING", payload: "9230" })
223 ).toEqual({
224 bookingCheck: [
225 {
226 bookingId: "92303869",
227 contact: "9867844311",
228 game: "FootBall",
229 name: "shelly",
230 slotDate: "6/12/2020",
231 slot:
232 { id: 3, startTime: "11.00 A.M", endTime: "12.00 P.M", slotStatus: "btn btn-success" }
233 }
234 ],
235 details: [
236 {
237 bookingId: "14440074",
238 contact: "9876443111",
239 game: "BasketBall",
240 name: "Roger",
241 slotDate: "6/12/2020",
242 slot:
243 { id: 4, startTime: "12.00 P.M", endTime: "01.00 P.M", slotStatus: "btn btn-success" }
244 },
245 {
246 bookingId: "92303869",
247 contact: "9867844311",
248 game: "FootBall",
249 name: "shelly",
250 slotDate: "6/12/2020",
251 slot:
252 { id: 3, startTime: "11.00 A.M", endTime: "12.00 P.M", slotStatus: "btn btn-success" }
253 }
254 ]
255 });
256 });
257});
258
search.test.js Raw
1test/search.test.js
2
3import React from "react";
4import { Search_Booking } from "../pages/search_booking";
5import { shallow } from "enzyme";
6import configureStore from "redux-mock-store";
7import { configure } from "enzyme";
8import Adapter from "enzyme-adapter-react-16";
9configure({ adapter: new Adapter() });
10
11const mockStore = configureStore([]);
12describe("Search Page", () => {
13 const historyMock = { push: jest.fn() };
14 const mockfn1 = jest.fn();
15 let store;
16 let emptyDetail;
17 let component;
18 let emptyCheck;
19 let noResult;
20 beforeEach(() => {
21 const Details = [
22 {
23 bookingId: "92303869",
24 contact: "9876443111",
25 game: "BasketBall",
26 name: "Roger",
27 slot:
28 { id: 4, startTime: "12.00 P.M", endTime: "01.00 P.M", slotStatus: "btn btn-success" }
29 },
30 {
31 bookingId: "14440074",
32 contact: "9867844311",
33 game: "FootBall",
34 name: "shelly",
35 slot:
36 { id: 3, startTime: "11.00 A.M", endTime: "12.00 P.M", slotStatus: "btn btn-success" }
37
38 }
39 ]
40
41 component = shallow(
42 <Search_Booking details={Details} check={mockfn1} history={historyMock} check={mockfn1} getGameAndBooking={mockfn1} />
43 )
44
45 });
46 it("DidMount", () => {
47 expect(mockfn1).toHaveBeenCalledTimes(1);
48 })
49 it("Search page Content", () => {
50 expect(component.find("header").length).toBe(1);
51 expect(component.find("header").childAt(0).length).toBe(1);
52 expect(component.find("header").text()).toEqual("Play Zone ");
53 component
54 .find("header")
55 .find("img")
56 .simulate("click");
57 expect(historyMock.push.mock.calls[0]).toEqual(["/"]);
58 expect(component.find("span").find(".Search").length).toBe(1);
59 });
60 it("empty search field", () => {
61 const tbody = component.find("table tbody");
62 component
63 .find(".Search")
64 .simulate("change", { target: { name: "Search", value: "" } });
65 expect(component.state().Search).toEqual(undefined);
66 const table_body1 = tbody.find("tr").map(child => child.render().text());
67 expect(table_body1).toEqual([
68 "92303869Roger9876443111BasketBall12.00 P.M-01.00 P.M",
69 "14440074shelly9867844311FootBall11.00 A.M-12.00 P.M"
70 ]);
71 });
72 it("table content after booking happend", () => {
73 const thead = component.find("table thead");
74 const table_header = thead.find("tr").map(child => child.text());
75 expect(table_header).toEqual([
76 "Booking IDSlot DateNameContact NoGameSlots"
77 ]);
78 const tbody = component.find("table tbody");
79 const table_body = tbody.find("tr").map(child => child.render().text());
80 expect(table_body).toEqual([
81 "92303869Roger9876443111BasketBall12.00 P.M-01.00 P.M",
82 "14440074shelly9867844311FootBall11.00 A.M-12.00 P.M"
83 ]);
84 });
85 it("no booking", () => {
86 const emptyDetail = []
87 const wrapper = shallow(<Search_Booking details={emptyDetail} check={mockfn1} getGameAndBooking={mockfn1} />)
88 const thead = wrapper.find("table thead");
89 const table_header = thead.find("tr").map(child => child.text());
90 expect(table_header).toEqual([
91 "Booking IDSlot DateNameContact NoGameSlots"
92 ]);
93 const msg = wrapper.find("p");
94 expect(msg.text()).toBe("No Booking happend yet");
95 });
96 it("search function", () => {
97 const Booking_Check1 = [
98 {
99 bookingId: "14440074",
100 contact: "9867844311",
101 game: "FootBall",
102 name: "shelly",
103 slot:
104 { id: 3, startTime: "11.00 A.M", endTime: "12.00 P.M", slotStatus: "btn btn-success" }
105 }
106 ]
107 const Details1 = [
108 {
109 bookingId: "92303869",
110 contact: "9876443111",
111 game: "BasketBall",
112 name: "Roger",
113 slot:
114 { id: 4, startTime: "12.00 P.M", endTime: "01.00 P.M", slotStatus: "btn btn-success" }
115 },
116 {
117 bookingId: "14440074",
118 contact: "9867844311",
119 game: "FootBall",
120 name: "shelly",
121 slot:
122 { id: 3, startTime: "11.00 A.M", endTime: "12.00 P.M", slotStatus: "btn btn-success" }
123
124 }
125 ]
126
127 const component = shallow(<Search_Booking details={Details1} checkBooking={Booking_Check1} check={mockfn1} getGameAndBooking={mockfn1} />)
128
129 component
130 .find(".Search")
131 .simulate("change", { target: { name: "Search", value: "14440074" } });
132 expect(component.state().Search).toEqual("14440074");
133 const thead = component.find("table thead");
134 const table_header = thead.find("tr").map(child => child.text());
135 expect(table_header).toEqual([
136 "Booking IDSlot DateNameContact NoGameSlots"
137 ]);
138 const tbody = component.find("table tbody");
139 const table_body = tbody.find("tr").map(child => child.render().text());
140 expect(table_body).toEqual([
141 "14440074shelly9867844311FootBall11.00 A.M-12.00 P.M"
142 ]);
143 });
144 it("no result found", () => {
145 const Booking_Check2 = []
146 const Details2 = [
147 {
148 bookingId: "92303869",
149 contact: "9876443111",
150 game: "BasketBall",
151 name: "Roger",
152 slot:
153 {
154 id: 3, startTime: "11.00 A.M", endTime: "12.00 P.M", slotStatus: "btn btn-success"
155 }
156 },
157 {
158 bookingId: "14440074",
159 contact: "9867844311",
160 game: "FootBall",
161 name: "shelly",
162 slot:
163 { id: 4, startTime: "12.00 P.M", endTime: "01.00 P.M", slotStatus: "btn btn-success" }
164 }
165 ]
166 const component = shallow(<Search_Booking details={Details2} checkBooking={Booking_Check2} check={mockfn1} getGameAndBooking={mockfn1} />)
167
168 component
169 .find(".Search")
170 .simulate("change", { target: { name: "Search", value: "222" } });
171 expect(component.state().Search).toEqual("222");
172 const thead = component.find("table thead");
173 const table_header = thead.find("tr").map(child => child.text());
174 expect(table_header).toEqual([
175 "Booking IDSlot DateNameContact NoGameSlots"
176 ]);
177 const msg = component.find("p");
178 expect(msg.text()).toBe("No Booking Found");
179 });
180});
181
searchbookings.js Raw
1pages/searchbookings.js
2
3import React, { Component } from "react";
4import { connect } from "react-redux";
5import { checkBooking } from "../Action/action";
6import icon from "../images/football.svg";
7export class Search_Booking extends Component {
8 state = {
9 Search: undefined
10 };
11
12 handleHomePage = () => {
13 //route to home page
14 };
15
16 render() {
17 return (
18 <div>
19 <div className="Home">
20 <header>
21 {/* header content goes here */}
22 <img
23 alt=""
24 id="icon"
25 width="40px"
26 height="40px"
27 src={icon}
28 onClick={this.handleHomePage}
29 />
30 </header>
31 </div>
32 <div>
33 <span>
34 {/* input field for the search field goes here with name "Search" */}
35 </span>
36 <div>
37 <table>
38 <thead>
39 <tr id="Book_List_header">
40 <td id="Book_List_header">Booking ID</td>
41 <td id="Book_List_header">Slot Date</td>
42 <td id="Book_List_header">Name</td>
43 <td id="Book_List_header">Contact No</td>
44 <td id="Book_List_header">Game</td>
45 <td id="Book_List_header">Slots</td>
46 </tr>
47 </thead>
48 </table>
49 {/* Display the Booking Details
50 use id as Book_List for td and ClassName as Booking_List for tr and tbody */}
51 </div>
52 </div>
53 </div>
54 );
55 }
56}
57
58const mapStateToProps = state => {
59 return {
60 checkBooking: state.bookingCheck,
61 details: state.details
62 };
63};
64const mapDispatchToProps = dispatch => {
65 return {
66 check: payload => dispatch(checkBooking(payload)),
67 getGameAndBooking: () => dispatch({ type: "GAME_BOOKING" })
68 };
69};
70
71export default connect(
72 mapStateToProps,
73 mapDispatchToProps
74)(Search_Booking);
75
76
slot.js Raw
1Components/slot.js
2
3import React, { Component } from "react";
4import { connect } from "react-redux";
5import { selectSlot } from "../Action/action";
6class Slots extends Component {
7 handleSlot = id => {
8 this.props.selectSlot(id);
9 };
10
11 render() {
12 // Template for each slot
13 // <div key={slot.id} className="slot_list">
14 // <h4>
15 // <span
16 // className={slot.slotStatus}
17 // style={{ cursor: "pointer" }}
18 // >
19
20 // </span>
21 // </h4>
22 // </div>
23
24 return (<div>
25 {/* code for slot goes here */}
26 </div>);
27 }
28}
29
30const mapStateToProps = state => {
31 return {
32 selectedGame: state.selectedGame,
33 bookingSlot: state.slotBooked
34 };
35};
36const mapDispatchToProps = dispatch => {
37 return {
38 selectSlot: id => dispatch(selectSlot(id))
39 };
40};
41
42export default connect(
43 mapStateToProps,
44 mapDispatchToProps
45)(Slots);
46
slot.test.js Raw
1test/slot.test.js
2
3import React from "react";
4import Slots from "../Component/slot";
5import { shallow } from "enzyme";
6import configureStore from "redux-mock-store";
7import { configure } from "enzyme";
8import Adapter from "enzyme-adapter-react-16";
9import BasketBall from "../images/basket_ball.jpeg";
10import VolleyBall from "../images/volleyBall.jpeg";
11import cricket from "../images/cricket_bat.jpg";
12import FootBall from "../images/football.jpeg";
13import {
14 bookSlot1,
15 bookSlot2,
16 bookSlot3,
17 bookSlot4
18} from "../Component/slot_data";
19
20configure({ adapter: new Adapter() });
21
22const mockStore = configureStore([]);
23describe("Slot component", () => {
24 const mockfn1 = jest.fn();
25 let store;
26 let component;
27 beforeEach(() => {
28 store = mockStore({
29 Games: [
30 { id: 0, src: BasketBall, name: "BasketBall", slots: bookSlot1 },
31 { id: 1, src: VolleyBall, name: "VolleyBall", slots: bookSlot2 },
32 { id: 2, src: cricket, name: "Cricket", slots: bookSlot3 },
33 { id: 3, src: FootBall, name: "FootBall", slots: bookSlot4 }
34 ],
35 selectedGame: {
36 id: 1,
37 src: VolleyBall,
38 name: "VolleyBall",
39 slots: [
40 { id: 1, startTime: "09.00 A.M", endTime: "10.00 A.M", slotStatus: "btn btn-success" },
41 { id: 2, startTime: "10.00 A.M", endTime: "11.00 A.M", slotStatus: "btn btn-success" },
42 { id: 3, startTime: "11.00 A.M", endTime: "12.00 P.M", slotStatus: "btn btn-success" },
43 { id: 4, startTime: "12.00 P.M", endTime: "01.00 P.M", slotStatus: "btn btn-success" },
44 { id: 5, startTime: "01.00 P.M", endTime: "02.00 P.M", slotStatus: "btn btn-success" },
45 { id: 6, startTime: "02.00 P.M", endTime: "03.00 P.M", slotStatus: "btn btn-success" },
46 { id: 7, startTime: "03.00 P.M", endTime: "04.00 P.M", slotStatus: "btn btn-success" },
47 { id: 8, startTime: "04.00 P.M", endTime: "05.00 P.M", slotStatus: "btn btn-success" },
48 { id: 9, startTime: "05.00 P.M", endTime: "06.00 P.M", slotStatus: "btn btn-success" }
49 ]
50 },
51 selectedDate: new Date(
52 new Date().getFullYear(),
53 new Date().getMonth(),
54 new Date().getDate() + 1
55 ),
56 slotBooked: [],
57 details: []
58 });
59 component = shallow(<Slots store={store} Select_Slot={mockfn1} />)
60 .childAt(0)
61 .dive();
62 });
63 it("Slot Content", () => {
64 let slot = component.find(".slot_list");
65 const Product = slot.find("h4").map(child => child.text());
66 expect(Product).toEqual([
67 "09.00 A.M - 10.00 A.M",
68 "10.00 A.M - 11.00 A.M",
69 "11.00 A.M - 12.00 P.M",
70 "12.00 P.M - 01.00 P.M",
71 "01.00 P.M - 02.00 P.M",
72 "02.00 P.M - 03.00 P.M",
73 "03.00 P.M - 04.00 P.M",
74 "04.00 P.M - 05.00 P.M",
75 "05.00 P.M - 06.00 P.M"
76 ]);
77 });
78 it("handle_Slot", () => {
79 const spy = jest.spyOn(component.instance(), "handleSlot");
80 let slot = component
81 .find(".slot_list")
82 .find("h4")
83 .find("span")
84 .at(3);
85 slot.simulate("click");
86 expect(spy).toBeCalledTimes(1);
87 });
88});
89
slot_data.js Raw
1Components/slot_data.js
2
3
4export const bookSlot1 = [
5 {
6 id: 1,
7 startTime: "09.00 A.M",
8 endTime: "10.00 A.M",
9 slotStatus: "btn btn-success"
10 },
11 {
12 id: 2,
13 startTime: "10.00 A.M",
14 endTime: "11.00 A.M",
15 slotStatus: "btn btn-success"
16 },
17 {
18 id: 3,
19 startTime: "11.00 A.M",
20 endTime: "12.00 P.M",
21 slotStatus: "btn btn-success"
22 },
23 {
24 id: 4,
25 startTime: "12.00 P.M",
26 endTime: "01.00 P.M",
27 slotStatus: "btn btn-success"
28 },
29 {
30 id: 5,
31 startTime: "01.00 P.M",
32 endTime: "02.00 P.M",
33 slotStatus: "btn btn-success"
34 },
35 {
36 id: 6,
37 startTime: "02.00 P.M",
38 endTime: "03.00 P.M",
39 slotStatus: "btn btn-success"
40 },
41 {
42 id: 7,
43 startTime: "03.00 P.M",
44 endTime: "04.00 P.M",
45 slotStatus: "btn btn-success"
46 },
47 {
48 id: 8,
49 startTime: "04.00 P.M",
50 endTime: "05.00 P.M",
51 slotStatus: "btn btn-success"
52 },
53 {
54 id: 9,
55 startTime: "05.00 P.M",
56 endTime: "06.00 P.M",
57 slotStatus: "btn btn-success"
58 }
59];
60
61export const bookSlot2 = [
62 {
63 id: 1,
64 startTime: "09.00 A.M",
65 endTime: "10.00 A.M",
66 slotStatus: "btn btn-success"
67 },
68 {
69 id: 2,
70 startTime: "10.00 A.M",
71 endTime: "11.00 A.M",
72 slotStatus: "btn btn-success"
73 },
74 {
75 id: 3,
76 startTime: "11.00 A.M",
77 endTime: "12.00 P.M",
78 slotStatus: "btn btn-success"
79 },
80 {
81 id: 4,
82 startTime: "12.00 P.M",
83 endTime: "01.00 P.M",
84 slotStatus: "btn btn-success"
85 },
86 {
87 id: 5,
88 startTime: "01.00 P.M",
89 endTime: "02.00 P.M",
90 slotStatus: "btn btn-success"
91 },
92 {
93 id: 6,
94 startTime: "02.00 P.M",
95 endTime: "03.00 P.M",
96 slotStatus: "btn btn-success"
97 },
98 {
99 id: 7,
100 startTime: "03.00 P.M",
101 endTime: "04.00 P.M",
102 slotStatus: "btn btn-success"
103 },
104 {
105 id: 8,
106 startTime: "04.00 P.M",
107 endTime: "05.00 P.M",
108 slotStatus: "btn btn-success"
109 },
110 {
111 id: 9,
112 startTime: "05.00 P.M",
113 endTime: "06.00 P.M",
114 slotStatus: "btn btn-success"
115 }
116];
117export const bookSlot3 = [
118 {
119 id: 1,
120 startTime: "09.00 A.M",
121 endTime: "10.00 A.M",
122 slotStatus: "btn btn-success"
123 },
124 {
125 id: 2,
126 startTime: "10.00 A.M",
127 endTime: "11.00 A.M",
128 slotStatus: "btn btn-success"
129 },
130 {
131 id: 3,
132 startTime: "11.00 A.M",
133 endTime: "12.00 P.M",
134 slotStatus: "btn btn-success"
135 },
136 {
137 id: 4,
138 startTime: "12.00 P.M",
139 endTime: "01.00 P.M",
140 slotStatus: "btn btn-success"
141 },
142 {
143 id: 5,
144 startTime: "01.00 P.M",
145 endTime: "02.00 P.M",
146 slotStatus: "btn btn-success"
147 },
148 {
149 id: 6,
150 startTime: "02.00 P.M",
151 endTime: "03.00 P.M",
152 slotStatus: "btn btn-success"
153 },
154 {
155 id: 7,
156 startTime: "03.00 P.M",
157 endTime: "04.00 P.M",
158 slotStatus: "btn btn-success"
159 },
160 {
161 id: 8,
162 startTime: "04.00 P.M",
163 endTime: "05.00 P.M",
164 slotStatus: "btn btn-success"
165 },
166 {
167 id: 9,
168 startTime: "05.00 P.M",
169 endTime: "06.00 P.M",
170 slotStatus: "btn btn-success"
171 }
172];
173export const bookSlot4 = [
174 {
175 id: 1,
176 startTime: "09.00 A.M",
177 endTime: "10.00 A.M",
178 slotStatus: "btn btn-success"
179 },
180 {
181 id: 2,
182 startTime: "10.00 A.M",
183 endTime: "11.00 A.M",
184 slotStatus: "btn btn-success"
185 },
186 {
187 id: 3,
188 startTime: "11.00 A.M",
189 endTime: "12.00 P.M",
190 slotStatus: "btn btn-success"
191 },
192 {
193 id: 4,
194 startTime: "12.00 P.M",
195 endTime: "01.00 P.M",
196 slotStatus: "btn btn-success"
197 },
198 {
199 id: 5,
200 startTime: "01.00 P.M",
201 endTime: "02.00 P.M",
202 slotStatus: "btn btn-success"
203 },
204 {
205 id: 6,
206 startTime: "02.00 P.M",
207 endTime: "03.00 P.M",
208 slotStatus: "btn btn-success"
209 },
210 {
211 id: 7,
212 startTime: "03.00 P.M",
213 endTime: "04.00 P.M",
214 slotStatus: "btn btn-success"
215 },
216 {
217 id: 8,
218 startTime: "04.00 P.M",
219 endTime: "05.00 P.M",
220 slotStatus: "btn btn-success"
221 },
222 {
223 id: 9,
224 startTime: "05.00 P.M",
225 endTime: "06.00 P.M",
226 slotStatus: "btn btn-success"
227 }
228];
229