You need NodeJs & NPM installed on your computer
git clone https://github.com/rowaidsayyed/hotels-app-code-challenge.git
cd hotels-app-code-challenge
npm install
npm run dev
npm run build
- User select the date range to search hotels
- Display all hotels whose availability dates lies between the search dates.
- Display the total number of nights based on selected date range. (For example if user search from Aug 12, 2020 to Aug 17, 2020 than Total Number of Nights will be 5.)
- Display hotel price based on number of nights. (Price x Number of Nights)
- Nextjs version 12.1.0
- Axios version 0.26.1
- ReactJS version 17.0.2
- Jest for Unit Testing version 27.4.5
- testing-library for react version 12.1.2
npm run test
- test "Button" component if render text and fire on click event
- test "getTotalNights" function
- test "getSortedList" function
- test "HotelCard" component if render hotel name and price
βββ components
β βββ layouts
β β βββ BasciLayout.js
β βββ hotelCard
β β βββ HotelCard.js
β βββ shared
β βββ Button.js
β βββ InputField.js
β βββ RangeInput.js
βββ pages
β βββ _app.js
β βββ index.js
β βββ listings.js
βββ services
β βββ api.js
β βββ hotelsServices.js
βββ utils
β βββ helperFunctions.js
βββ styles
β βββ globals.css
β βββ utils.css
β βββ HotelCard.modul.css
βββ __tests__
β βββ button.test.jsx
β βββ helpers.test.jsx
βββ jsconfig.json