Advertisement
Guest User

Untitled

a guest
Jan 30th, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.41 KB | None | 0 0
  1. /admin endpoint
  2. 1) Get the total registered users per day
  3. 2) Get the 5 best selling products
  4. ✓ Get the sum of the orders per week
  5.  
  6. /favourites endpoint
  7. ✓ Get the favourite list of an user
  8. ✓ Get a non existing favourite list
  9. 3) Get the user from a favourite list
  10. ✓ Get the products from a favourite list
  11. INSERT INTO Favourites SET ?
  12. ✓ Add a product to a favourite list
  13. DELETE from Favourites WHERE user_id = '5' AND product_id = '5'
  14. 4) Delete a product from a favourite list
  15. DELETE from Favourites WHERE user_id = '10' AND product_id = '10'
  16. ✓ Delete a non existing product from a favourite list
  17.  
  18. /orderlines endpoint
  19. ✓ Get a orderline info by id
  20. ✓ Show all orderlines by id
  21. ✓ Show product
  22. INSERT INTO Order_lines SET ?
  23. ✓ Create an orderline
  24.  
  25. /orders endpoint
  26. 5) Get a order by id
  27. 6) Get the last order_id
  28. INSERT INTO Orders SET ?
  29. ✓ Add a product to a favourite list
  30. UPDATE Orders SET boolean_deleted = 1 WHERE order_id = '20'
  31. ✓ Delete an order
  32.  
  33. Product backend is properly functioning
  34. ✓ Get a product by id
  35. ✓ Create a new product
  36.  
  37. /users
  38. INSERT INTO Product SET ?
  39. 7) Get all users
  40. ✓ Get an user by id
  41. 8) Look for an username
  42. 9) Look for an user with specific username/password
  43. 10) Update an user
  44. UPDATE User SET ? WHERE user_id = '6'
  45. ✓ Delete an user
  46. UPDATE User SET boolean_deleted = 1 WHERE user_id = '2'
  47.  
  48. /wishlist
  49. ✓ Get all wishlists that arent hidden
  50. 11) Get all products from an user wishlist
  51. ✓ Get hidden status of a wishlist
  52. 12) See if a wish exists
  53. ✓ Create a new wish
  54.  
  55.  
  56. 19 passing (572ms)
  57. 12 failing
  58.  
  59. 1) /admin endpoint Get the total registered users per day:
  60. Uncaught AssertionError: Body
  61.  
  62. Actual: [ { day: [ 1, 3, 6 ], users: [ 27, 29, 30 ] } ]
  63. Expected: [ { day: [ 1, 3, 5 ], users: [ 27, 29, 30 ] } ]
  64.  
  65. at assert (node_modules/hippie/lib/hippie/assert.js:36:10)
  66. at value (node_modules/hippie/lib/hippie/expect.js:92:10)
  67. at verify (node_modules/hippie/lib/hippie/client.js:476:5)
  68. at statusCode (node_modules/hippie/lib/hippie/expect.js:23:5)
  69. at verify (node_modules/hippie/lib/hippie/client.js:476:5)
  70. at Client.verify (node_modules/hippie/lib/hippie/client.js:477:5)
  71. at node_modules/hippie/lib/hippie/client.js:437:12
  72. at Client.exports.json [as parse] (node_modules/hippie/lib/hippie/parsers.js:21:3)
  73. at Request._callback (node_modules/hippie/lib/hippie/client.js:435:10)
  74. at Request.self.callback (node_modules/request/request.js:187:22)
  75. at Request.<anonymous> (node_modules/request/request.js:1044:10)
  76. at IncomingMessage.<anonymous> (node_modules/request/request.js:965:12)
  77. at endReadableNT (_stream_readable.js:974:12)
  78. at _combinedTickCallback (internal/process/next_tick.js:74:11)
  79. at process._tickDomainCallback (internal/process/next_tick.js:122:9)
  80.  
  81. 2) /admin endpoint Get the 5 best selling products:
  82. Uncaught AssertionError: Body
  83.  
  84. Actual: [ { productnames: [ 'test_product_deleted', 'test_product' ],
  85. amount: [ 11, 1 ] } ]
  86. Expected: [ { productnames: [ 'test_product_deleted', 'test_product' ],
  87. amount: [ 2, 1 ] } ]
  88.  
  89. at assert (node_modules/hippie/lib/hippie/assert.js:36:10)
  90. at value (node_modules/hippie/lib/hippie/expect.js:92:10)
  91. at verify (node_modules/hippie/lib/hippie/client.js:476:5)
  92. at statusCode (node_modules/hippie/lib/hippie/expect.js:23:5)
  93. at verify (node_modules/hippie/lib/hippie/client.js:476:5)
  94. at Client.verify (node_modules/hippie/lib/hippie/client.js:477:5)
  95. at node_modules/hippie/lib/hippie/client.js:437:12
  96. at Client.exports.json [as parse] (node_modules/hippie/lib/hippie/parsers.js:21:3)
  97. at Request._callback (node_modules/hippie/lib/hippie/client.js:435:10)
  98. at Request.self.callback (node_modules/request/request.js:187:22)
  99. at Request.<anonymous> (node_modules/request/request.js:1044:10)
  100. at IncomingMessage.<anonymous> (node_modules/request/request.js:965:12)
  101. at endReadableNT (_stream_readable.js:974:12)
  102. at _combinedTickCallback (internal/process/next_tick.js:74:11)
  103. at process._tickDomainCallback (internal/process/next_tick.js:122:9)
  104.  
  105. 3) /favourites endpoint Get the user from a favourite list:
  106. Uncaught AssertionError: Body
  107.  
  108. Actual: [ { user_id: 1,
  109. username: 'test_user',
  110. password: '123',
  111. email: 'test@tset.nl',
  112. admin: 0,
  113. date_of_birth: '2000-10-10T00:00:00.000Z',
  114. create_date: '2017-01-27T00:00:00.000Z',
  115. boolean_deleted: 0,
  116. boolean_banned: 0,
  117. token: null } ]
  118. Expected: [ { user_id: 1,
  119. username: 'test_user',
  120. password: '123',
  121. email: 'test@tset.nl',
  122. admin: 0,
  123. date_of_birth: '2000-10-09T22:00:00.000Z',
  124. create_date: '2017-01-26T23:00:00.000Z',
  125. boolean_deleted: 0,
  126. boolean_banned: 0,
  127. token: null } ]
  128.  
  129. at assert (node_modules/hippie/lib/hippie/assert.js:36:10)
  130. at value (node_modules/hippie/lib/hippie/expect.js:92:10)
  131. at verify (node_modules/hippie/lib/hippie/client.js:476:5)
  132. at statusCode (node_modules/hippie/lib/hippie/expect.js:23:5)
  133. at verify (node_modules/hippie/lib/hippie/client.js:476:5)
  134. at Client.verify (node_modules/hippie/lib/hippie/client.js:477:5)
  135. at node_modules/hippie/lib/hippie/client.js:437:12
  136. at Client.exports.json [as parse] (node_modules/hippie/lib/hippie/parsers.js:21:3)
  137. at Request._callback (node_modules/hippie/lib/hippie/client.js:435:10)
  138. at Request.self.callback (node_modules/request/request.js:187:22)
  139. at Request.<anonymous> (node_modules/request/request.js:1044:10)
  140. at IncomingMessage.<anonymous> (node_modules/request/request.js:965:12)
  141. at endReadableNT (_stream_readable.js:974:12)
  142. at _combinedTickCallback (internal/process/next_tick.js:74:11)
  143. at process._tickDomainCallback (internal/process/next_tick.js:122:9)
  144.  
  145. 4) /favourites endpoint Delete a product from a favourite list:
  146. Uncaught AssertionError: Body
  147.  
  148. Actual: '"Affected rows: 2"'
  149. Expected: '"Affected rows: 1"'
  150.  
  151. at assert (node_modules/hippie/lib/hippie/assert.js:36:10)
  152. at value (node_modules/hippie/lib/hippie/expect.js:92:10)
  153. at verify (node_modules/hippie/lib/hippie/client.js:476:5)
  154. at statusCode (node_modules/hippie/lib/hippie/expect.js:23:5)
  155. at verify (node_modules/hippie/lib/hippie/client.js:476:5)
  156. at Client.verify (node_modules/hippie/lib/hippie/client.js:477:5)
  157. at node_modules/hippie/lib/hippie/client.js:437:12
  158. at Client.exports.json [as parse] (node_modules/hippie/lib/hippie/parsers.js:21:3)
  159. at Request._callback (node_modules/hippie/lib/hippie/client.js:435:10)
  160. at Request.self.callback (node_modules/request/request.js:187:22)
  161. at Request.<anonymous> (node_modules/request/request.js:1044:10)
  162. at IncomingMessage.<anonymous> (node_modules/request/request.js:965:12)
  163. at endReadableNT (_stream_readable.js:974:12)
  164. at _combinedTickCallback (internal/process/next_tick.js:74:11)
  165. at process._tickDomainCallback (internal/process/next_tick.js:122:9)
  166.  
  167. 5) /orders endpoint Get a order by id:
  168. Uncaught AssertionError: Body
  169.  
  170. Actual: [ { order_id: 1,
  171. user_id: 1,
  172. order_date: '2017-01-28T13:24:05.000Z',
  173. firstname: 'firstname',
  174. lastname: 'lastname',
  175. address_id: 1,
  176. phonenumber: '123456',
  177. order_status: null,
  178. boolean_deleted: 0 } ]
  179. Expected: [ { order_id: 1,
  180. user_id: 1,
  181. order_date: '2017-01-28T12:24:05.000Z',
  182. firstname: 'firstname',
  183. lastname: 'lastname',
  184. address_id: 1,
  185. phonenumber: '123456',
  186. order_status: null,
  187. boolean_deleted: 0 } ]
  188.  
  189. at assert (node_modules/hippie/lib/hippie/assert.js:36:10)
  190. at value (node_modules/hippie/lib/hippie/expect.js:92:10)
  191. at verify (node_modules/hippie/lib/hippie/client.js:476:5)
  192. at statusCode (node_modules/hippie/lib/hippie/expect.js:23:5)
  193. at verify (node_modules/hippie/lib/hippie/client.js:476:5)
  194. at Client.verify (node_modules/hippie/lib/hippie/client.js:477:5)
  195. at node_modules/hippie/lib/hippie/client.js:437:12
  196. at Client.exports.json [as parse] (node_modules/hippie/lib/hippie/parsers.js:21:3)
  197. at Request._callback (node_modules/hippie/lib/hippie/client.js:435:10)
  198. at Request.self.callback (node_modules/request/request.js:187:22)
  199. at Request.<anonymous> (node_modules/request/request.js:1044:10)
  200. at IncomingMessage.<anonymous> (node_modules/request/request.js:965:12)
  201. at endReadableNT (_stream_readable.js:974:12)
  202. at _combinedTickCallback (internal/process/next_tick.js:74:11)
  203. at process._tickDomainCallback (internal/process/next_tick.js:122:9)
  204.  
  205. 6) /orders endpoint Get the last order_id:
  206. Uncaught AssertionError: Body
  207.  
  208. Actual: [ { order_id: 33 } ]
  209. Expected: [ { order_id: 24 } ]
  210.  
  211. at assert (node_modules/hippie/lib/hippie/assert.js:36:10)
  212. at value (node_modules/hippie/lib/hippie/expect.js:92:10)
  213. at verify (node_modules/hippie/lib/hippie/client.js:476:5)
  214. at statusCode (node_modules/hippie/lib/hippie/expect.js:23:5)
  215. at verify (node_modules/hippie/lib/hippie/client.js:476:5)
  216. at Client.verify (node_modules/hippie/lib/hippie/client.js:477:5)
  217. at node_modules/hippie/lib/hippie/client.js:437:12
  218. at Client.exports.json [as parse] (node_modules/hippie/lib/hippie/parsers.js:21:3)
  219. at Request._callback (node_modules/hippie/lib/hippie/client.js:435:10)
  220. at Request.self.callback (node_modules/request/request.js:187:22)
  221. at Request.<anonymous> (node_modules/request/request.js:1044:10)
  222. at IncomingMessage.<anonymous> (node_modules/request/request.js:965:12)
  223. at endReadableNT (_stream_readable.js:974:12)
  224. at _combinedTickCallback (internal/process/next_tick.js:74:11)
  225. at process._tickDomainCallback (internal/process/next_tick.js:122:9)
  226.  
  227. 7) /users Get all users:
  228. Uncaught ReferenceError: done is not defined
  229. at test/products.js:51:9
  230. at verify (node_modules/hippie/lib/hippie/client.js:475:32)
  231. at statusCode (node_modules/hippie/lib/hippie/expect.js:23:5)
  232. at verify (node_modules/hippie/lib/hippie/client.js:476:5)
  233. at Client.verify (node_modules/hippie/lib/hippie/client.js:477:5)
  234. at node_modules/hippie/lib/hippie/client.js:437:12
  235. at Client.exports.json [as parse] (node_modules/hippie/lib/hippie/parsers.js:21:3)
  236. at Request._callback (node_modules/hippie/lib/hippie/client.js:435:10)
  237. at Request.self.callback (node_modules/request/request.js:187:22)
  238. at Request.<anonymous> (node_modules/request/request.js:1044:10)
  239. at IncomingMessage.<anonymous> (node_modules/request/request.js:965:12)
  240. at endReadableNT (_stream_readable.js:974:12)
  241. at _combinedTickCallback (internal/process/next_tick.js:74:11)
  242. at process._tickDomainCallback (internal/process/next_tick.js:122:9)
  243.  
  244. 8) /users Look for an username:
  245. Uncaught AssertionError: Body
  246.  
  247. Actual: [ { user_id: 1,
  248. username: 'test_user',
  249. password: '123',
  250. email: 'test@tset.nl',
  251. admin: 0,
  252. date_of_birth: '2000-10-10T00:00:00.000Z',
  253. create_date: '2017-01-27T00:00:00.000Z',
  254. boolean_deleted: 0,
  255. boolean_banned: 0,
  256. token: null } ]
  257. Expected: [ { user_id: 1,
  258. username: 'test_user',
  259. password: '123',
  260. email: 'test@tset.nl',
  261. admin: 0,
  262. date_of_birth: '2000-10-09T22:00:00.000Z',
  263. create_date: '2017-01-26T23:00:00.000Z',
  264. boolean_deleted: 0,
  265. boolean_banned: 0,
  266. token: null } ]
  267.  
  268. at assert (node_modules/hippie/lib/hippie/assert.js:36:10)
  269. at value (node_modules/hippie/lib/hippie/expect.js:92:10)
  270. at verify (node_modules/hippie/lib/hippie/client.js:476:5)
  271. at statusCode (node_modules/hippie/lib/hippie/expect.js:23:5)
  272. at verify (node_modules/hippie/lib/hippie/client.js:476:5)
  273. at Client.verify (node_modules/hippie/lib/hippie/client.js:477:5)
  274. at node_modules/hippie/lib/hippie/client.js:437:12
  275. at Client.exports.json [as parse] (node_modules/hippie/lib/hippie/parsers.js:21:3)
  276. at Request._callback (node_modules/hippie/lib/hippie/client.js:435:10)
  277. at Request.self.callback (node_modules/request/request.js:187:22)
  278. at Request.<anonymous> (node_modules/request/request.js:1044:10)
  279. at IncomingMessage.<anonymous> (node_modules/request/request.js:965:12)
  280. at endReadableNT (_stream_readable.js:974:12)
  281. at _combinedTickCallback (internal/process/next_tick.js:74:11)
  282. at process._tickDomainCallback (internal/process/next_tick.js:122:9)
  283.  
  284. 9) /users Look for an user with specific username/password:
  285. Uncaught AssertionError: Body
  286.  
  287. Actual: [ { user_id: 1,
  288. username: 'test_user',
  289. password: '123',
  290. email: 'test@tset.nl',
  291. admin: 0,
  292. date_of_birth: '2000-10-10T00:00:00.000Z',
  293. create_date: '2017-01-27T00:00:00.000Z',
  294. boolean_deleted: 0,
  295. boolean_banned: 0,
  296. token: null } ]
  297. Expected: [ { user_id: 1,
  298. username: 'test_user',
  299. password: '123',
  300. email: 'test@tset.nl',
  301. admin: 0,
  302. date_of_birth: '2000-10-09T22:00:00.000Z',
  303. create_date: '2017-01-26T23:00:00.000Z',
  304. boolean_deleted: 0,
  305. boolean_banned: 0,
  306. token: null } ]
  307.  
  308. at assert (node_modules/hippie/lib/hippie/assert.js:36:10)
  309. at value (node_modules/hippie/lib/hippie/expect.js:92:10)
  310. at verify (node_modules/hippie/lib/hippie/client.js:476:5)
  311. at statusCode (node_modules/hippie/lib/hippie/expect.js:23:5)
  312. at verify (node_modules/hippie/lib/hippie/client.js:476:5)
  313. at Client.verify (node_modules/hippie/lib/hippie/client.js:477:5)
  314. at node_modules/hippie/lib/hippie/client.js:437:12
  315. at Client.exports.json [as parse] (node_modules/hippie/lib/hippie/parsers.js:21:3)
  316. at Request._callback (node_modules/hippie/lib/hippie/client.js:435:10)
  317. at Request.self.callback (node_modules/request/request.js:187:22)
  318. at Request.<anonymous> (node_modules/request/request.js:1044:10)
  319. at IncomingMessage.<anonymous> (node_modules/request/request.js:965:12)
  320. at endReadableNT (_stream_readable.js:974:12)
  321. at _combinedTickCallback (internal/process/next_tick.js:74:11)
  322. at process._tickDomainCallback (internal/process/next_tick.js:122:9)
  323.  
  324. 10) /users Update an user:
  325. Uncaught AssertionError: Body
  326.  
  327. Actual: [ { user_id: 1,
  328. username: 'test_user',
  329. password: '123',
  330. email: 'test@tset.nl',
  331. admin: 0,
  332. date_of_birth: '2000-10-10T00:00:00.000Z',
  333. create_date: '2017-01-27T00:00:00.000Z',
  334. boolean_deleted: 0,
  335. boolean_banned: 0,
  336. token: null } ]
  337. Expected: [ { user_id: 1,
  338. username: 'test_user',
  339. password: '123',
  340. email: 'test@tset.nl',
  341. admin: 0,
  342. date_of_birth: '2000-10-09T22:00:00.000Z',
  343. create_date: '2017-01-26T23:00:00.000Z',
  344. boolean_deleted: 0,
  345. boolean_banned: 0,
  346. token: null } ]
  347.  
  348. at assert (node_modules/hippie/lib/hippie/assert.js:36:10)
  349. at value (node_modules/hippie/lib/hippie/expect.js:92:10)
  350. at verify (node_modules/hippie/lib/hippie/client.js:476:5)
  351. at statusCode (node_modules/hippie/lib/hippie/expect.js:23:5)
  352. at verify (node_modules/hippie/lib/hippie/client.js:476:5)
  353. at Client.verify (node_modules/hippie/lib/hippie/client.js:477:5)
  354. at node_modules/hippie/lib/hippie/client.js:437:12
  355. at Client.exports.json [as parse] (node_modules/hippie/lib/hippie/parsers.js:21:3)
  356. at Request._callback (node_modules/hippie/lib/hippie/client.js:435:10)
  357. at Request.self.callback (node_modules/request/request.js:187:22)
  358. at Request.<anonymous> (node_modules/request/request.js:1044:10)
  359. at IncomingMessage.<anonymous> (node_modules/request/request.js:965:12)
  360. at endReadableNT (_stream_readable.js:974:12)
  361. at _combinedTickCallback (internal/process/next_tick.js:74:11)
  362. at process._tickDomainCallback (internal/process/next_tick.js:122:9)
  363.  
  364. 11) /wishlist Get all products from an user wishlist:
  365. Uncaught AssertionError: Body
  366.  
  367. Actual: [ { user_id: 26,
  368. product_id: 1,
  369. addition_date: '2017-01-30T00:00:00.000Z',
  370. hidden: 0,
  371. boolean_deleted: 0,
  372. p_name: 'test_product',
  373. p_description: 'This is a test product',
  374. p_price: '100',
  375. p_brand: 'brand',
  376. p_model: 'model',
  377. p_submodel: 'sub_model',
  378. p_color: 'color',
  379. p_construction_year: 2000,
  380. p_image: 'https://openclipart.org/image/2400px/svg_to_png/222252/feels.png' } ]
  381. Expected: [ { user_id: 26,
  382. product_id: 1,
  383. addition_date: '2017-01-29T23:00:00.000Z',
  384. hidden: 0,
  385. boolean_deleted: 0,
  386. p_name: 'test_product',
  387. p_description: 'This is a test product',
  388. p_price: '100',
  389. p_brand: 'brand',
  390. p_model: 'model',
  391. p_submodel: 'sub_model',
  392. p_color: 'color',
  393. p_construction_year: 2000,
  394. p_image: 'https://openclipart.org/image/2400px/svg_to_png/222252/feels.png' } ]
  395.  
  396. at assert (node_modules/hippie/lib/hippie/assert.js:36:10)
  397. at value (node_modules/hippie/lib/hippie/expect.js:92:10)
  398. at verify (node_modules/hippie/lib/hippie/client.js:476:5)
  399. at statusCode (node_modules/hippie/lib/hippie/expect.js:23:5)
  400. at verify (node_modules/hippie/lib/hippie/client.js:476:5)
  401. at Client.verify (node_modules/hippie/lib/hippie/client.js:477:5)
  402. at node_modules/hippie/lib/hippie/client.js:437:12
  403. at Client.exports.json [as parse] (node_modules/hippie/lib/hippie/parsers.js:21:3)
  404. at Request._callback (node_modules/hippie/lib/hippie/client.js:435:10)
  405. at Request.self.callback (node_modules/request/request.js:187:22)
  406. at Request.<anonymous> (node_modules/request/request.js:1044:10)
  407. at IncomingMessage.<anonymous> (node_modules/request/request.js:965:12)
  408. at endReadableNT (_stream_readable.js:974:12)
  409. at _combinedTickCallback (internal/process/next_tick.js:74:11)
  410. at process._tickDomainCallback (internal/process/next_tick.js:122:9)
  411.  
  412. 12) /wishlist See if a wish exists:
  413. Uncaught AssertionError: Body
  414.  
  415. Actual: [ { user_id: 1,
  416. product_id: 2,
  417. addition_date: '2017-01-29T00:00:00.000Z',
  418. hidden: 0,
  419. boolean_deleted: 0 } ]
  420. Expected: [ { user_id: 1,
  421. product_id: 2,
  422. addition_date: '2017-01-28T23:00:00.000Z',
  423. hidden: 0,
  424. boolean_deleted: 0 } ]
  425.  
  426. at assert (node_modules/hippie/lib/hippie/assert.js:36:10)
  427. at value (node_modules/hippie/lib/hippie/expect.js:92:10)
  428. at verify (node_modules/hippie/lib/hippie/client.js:476:5)
  429. at statusCode (node_modules/hippie/lib/hippie/expect.js:23:5)
  430. at verify (node_modules/hippie/lib/hippie/client.js:476:5)
  431. at Client.verify (node_modules/hippie/lib/hippie/client.js:477:5)
  432. at node_modules/hippie/lib/hippie/client.js:437:12
  433. at Client.exports.json [as parse] (node_modules/hippie/lib/hippie/parsers.js:21:3)
  434. at Request._callback (node_modules/hippie/lib/hippie/client.js:435:10)
  435. at Request.self.callback (node_modules/request/request.js:187:22)
  436. at Request.<anonymous> (node_modules/request/request.js:1044:10)
  437. at IncomingMessage.<anonymous> (node_modules/request/request.js:965:12)
  438. at endReadableNT (_stream_readable.js:974:12)
  439. at _combinedTickCallback (internal/process/next_tick.js:74:11)
  440. at process._tickDomainCallback (internal/process/next_tick.js:122:9)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement