Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /admin endpoint
- 1) Get the total registered users per day
- 2) Get the 5 best selling products
- ✓ Get the sum of the orders per week
- /favourites endpoint
- ✓ Get the favourite list of an user
- ✓ Get a non existing favourite list
- 3) Get the user from a favourite list
- ✓ Get the products from a favourite list
- INSERT INTO Favourites SET ?
- ✓ Add a product to a favourite list
- DELETE from Favourites WHERE user_id = '5' AND product_id = '5'
- 4) Delete a product from a favourite list
- DELETE from Favourites WHERE user_id = '10' AND product_id = '10'
- ✓ Delete a non existing product from a favourite list
- /orderlines endpoint
- ✓ Get a orderline info by id
- ✓ Show all orderlines by id
- ✓ Show product
- INSERT INTO Order_lines SET ?
- ✓ Create an orderline
- /orders endpoint
- 5) Get a order by id
- 6) Get the last order_id
- INSERT INTO Orders SET ?
- ✓ Add a product to a favourite list
- UPDATE Orders SET boolean_deleted = 1 WHERE order_id = '20'
- ✓ Delete an order
- Product backend is properly functioning
- ✓ Get a product by id
- ✓ Create a new product
- /users
- INSERT INTO Product SET ?
- 7) Get all users
- ✓ Get an user by id
- 8) Look for an username
- 9) Look for an user with specific username/password
- 10) Update an user
- UPDATE User SET ? WHERE user_id = '6'
- ✓ Delete an user
- UPDATE User SET boolean_deleted = 1 WHERE user_id = '2'
- /wishlist
- ✓ Get all wishlists that arent hidden
- 11) Get all products from an user wishlist
- ✓ Get hidden status of a wishlist
- 12) See if a wish exists
- ✓ Create a new wish
- 19 passing (572ms)
- 12 failing
- 1) /admin endpoint Get the total registered users per day:
- Uncaught AssertionError: Body
- Actual: [ { day: [ 1, 3, 6 ], users: [ 27, 29, 30 ] } ]
- Expected: [ { day: [ 1, 3, 5 ], users: [ 27, 29, 30 ] } ]
- at assert (node_modules/hippie/lib/hippie/assert.js:36:10)
- at value (node_modules/hippie/lib/hippie/expect.js:92:10)
- at verify (node_modules/hippie/lib/hippie/client.js:476:5)
- at statusCode (node_modules/hippie/lib/hippie/expect.js:23:5)
- at verify (node_modules/hippie/lib/hippie/client.js:476:5)
- at Client.verify (node_modules/hippie/lib/hippie/client.js:477:5)
- at node_modules/hippie/lib/hippie/client.js:437:12
- at Client.exports.json [as parse] (node_modules/hippie/lib/hippie/parsers.js:21:3)
- at Request._callback (node_modules/hippie/lib/hippie/client.js:435:10)
- at Request.self.callback (node_modules/request/request.js:187:22)
- at Request.<anonymous> (node_modules/request/request.js:1044:10)
- at IncomingMessage.<anonymous> (node_modules/request/request.js:965:12)
- at endReadableNT (_stream_readable.js:974:12)
- at _combinedTickCallback (internal/process/next_tick.js:74:11)
- at process._tickDomainCallback (internal/process/next_tick.js:122:9)
- 2) /admin endpoint Get the 5 best selling products:
- Uncaught AssertionError: Body
- Actual: [ { productnames: [ 'test_product_deleted', 'test_product' ],
- amount: [ 11, 1 ] } ]
- Expected: [ { productnames: [ 'test_product_deleted', 'test_product' ],
- amount: [ 2, 1 ] } ]
- at assert (node_modules/hippie/lib/hippie/assert.js:36:10)
- at value (node_modules/hippie/lib/hippie/expect.js:92:10)
- at verify (node_modules/hippie/lib/hippie/client.js:476:5)
- at statusCode (node_modules/hippie/lib/hippie/expect.js:23:5)
- at verify (node_modules/hippie/lib/hippie/client.js:476:5)
- at Client.verify (node_modules/hippie/lib/hippie/client.js:477:5)
- at node_modules/hippie/lib/hippie/client.js:437:12
- at Client.exports.json [as parse] (node_modules/hippie/lib/hippie/parsers.js:21:3)
- at Request._callback (node_modules/hippie/lib/hippie/client.js:435:10)
- at Request.self.callback (node_modules/request/request.js:187:22)
- at Request.<anonymous> (node_modules/request/request.js:1044:10)
- at IncomingMessage.<anonymous> (node_modules/request/request.js:965:12)
- at endReadableNT (_stream_readable.js:974:12)
- at _combinedTickCallback (internal/process/next_tick.js:74:11)
- at process._tickDomainCallback (internal/process/next_tick.js:122:9)
- 3) /favourites endpoint Get the user from a favourite list:
- Uncaught AssertionError: Body
- Actual: [ { user_id: 1,
- username: 'test_user',
- password: '123',
- email: 'test@tset.nl',
- admin: 0,
- date_of_birth: '2000-10-10T00:00:00.000Z',
- create_date: '2017-01-27T00:00:00.000Z',
- boolean_deleted: 0,
- boolean_banned: 0,
- token: null } ]
- Expected: [ { user_id: 1,
- username: 'test_user',
- password: '123',
- email: 'test@tset.nl',
- admin: 0,
- date_of_birth: '2000-10-09T22:00:00.000Z',
- create_date: '2017-01-26T23:00:00.000Z',
- boolean_deleted: 0,
- boolean_banned: 0,
- token: null } ]
- at assert (node_modules/hippie/lib/hippie/assert.js:36:10)
- at value (node_modules/hippie/lib/hippie/expect.js:92:10)
- at verify (node_modules/hippie/lib/hippie/client.js:476:5)
- at statusCode (node_modules/hippie/lib/hippie/expect.js:23:5)
- at verify (node_modules/hippie/lib/hippie/client.js:476:5)
- at Client.verify (node_modules/hippie/lib/hippie/client.js:477:5)
- at node_modules/hippie/lib/hippie/client.js:437:12
- at Client.exports.json [as parse] (node_modules/hippie/lib/hippie/parsers.js:21:3)
- at Request._callback (node_modules/hippie/lib/hippie/client.js:435:10)
- at Request.self.callback (node_modules/request/request.js:187:22)
- at Request.<anonymous> (node_modules/request/request.js:1044:10)
- at IncomingMessage.<anonymous> (node_modules/request/request.js:965:12)
- at endReadableNT (_stream_readable.js:974:12)
- at _combinedTickCallback (internal/process/next_tick.js:74:11)
- at process._tickDomainCallback (internal/process/next_tick.js:122:9)
- 4) /favourites endpoint Delete a product from a favourite list:
- Uncaught AssertionError: Body
- Actual: '"Affected rows: 2"'
- Expected: '"Affected rows: 1"'
- at assert (node_modules/hippie/lib/hippie/assert.js:36:10)
- at value (node_modules/hippie/lib/hippie/expect.js:92:10)
- at verify (node_modules/hippie/lib/hippie/client.js:476:5)
- at statusCode (node_modules/hippie/lib/hippie/expect.js:23:5)
- at verify (node_modules/hippie/lib/hippie/client.js:476:5)
- at Client.verify (node_modules/hippie/lib/hippie/client.js:477:5)
- at node_modules/hippie/lib/hippie/client.js:437:12
- at Client.exports.json [as parse] (node_modules/hippie/lib/hippie/parsers.js:21:3)
- at Request._callback (node_modules/hippie/lib/hippie/client.js:435:10)
- at Request.self.callback (node_modules/request/request.js:187:22)
- at Request.<anonymous> (node_modules/request/request.js:1044:10)
- at IncomingMessage.<anonymous> (node_modules/request/request.js:965:12)
- at endReadableNT (_stream_readable.js:974:12)
- at _combinedTickCallback (internal/process/next_tick.js:74:11)
- at process._tickDomainCallback (internal/process/next_tick.js:122:9)
- 5) /orders endpoint Get a order by id:
- Uncaught AssertionError: Body
- Actual: [ { order_id: 1,
- user_id: 1,
- order_date: '2017-01-28T13:24:05.000Z',
- firstname: 'firstname',
- lastname: 'lastname',
- address_id: 1,
- phonenumber: '123456',
- order_status: null,
- boolean_deleted: 0 } ]
- Expected: [ { order_id: 1,
- user_id: 1,
- order_date: '2017-01-28T12:24:05.000Z',
- firstname: 'firstname',
- lastname: 'lastname',
- address_id: 1,
- phonenumber: '123456',
- order_status: null,
- boolean_deleted: 0 } ]
- at assert (node_modules/hippie/lib/hippie/assert.js:36:10)
- at value (node_modules/hippie/lib/hippie/expect.js:92:10)
- at verify (node_modules/hippie/lib/hippie/client.js:476:5)
- at statusCode (node_modules/hippie/lib/hippie/expect.js:23:5)
- at verify (node_modules/hippie/lib/hippie/client.js:476:5)
- at Client.verify (node_modules/hippie/lib/hippie/client.js:477:5)
- at node_modules/hippie/lib/hippie/client.js:437:12
- at Client.exports.json [as parse] (node_modules/hippie/lib/hippie/parsers.js:21:3)
- at Request._callback (node_modules/hippie/lib/hippie/client.js:435:10)
- at Request.self.callback (node_modules/request/request.js:187:22)
- at Request.<anonymous> (node_modules/request/request.js:1044:10)
- at IncomingMessage.<anonymous> (node_modules/request/request.js:965:12)
- at endReadableNT (_stream_readable.js:974:12)
- at _combinedTickCallback (internal/process/next_tick.js:74:11)
- at process._tickDomainCallback (internal/process/next_tick.js:122:9)
- 6) /orders endpoint Get the last order_id:
- Uncaught AssertionError: Body
- Actual: [ { order_id: 33 } ]
- Expected: [ { order_id: 24 } ]
- at assert (node_modules/hippie/lib/hippie/assert.js:36:10)
- at value (node_modules/hippie/lib/hippie/expect.js:92:10)
- at verify (node_modules/hippie/lib/hippie/client.js:476:5)
- at statusCode (node_modules/hippie/lib/hippie/expect.js:23:5)
- at verify (node_modules/hippie/lib/hippie/client.js:476:5)
- at Client.verify (node_modules/hippie/lib/hippie/client.js:477:5)
- at node_modules/hippie/lib/hippie/client.js:437:12
- at Client.exports.json [as parse] (node_modules/hippie/lib/hippie/parsers.js:21:3)
- at Request._callback (node_modules/hippie/lib/hippie/client.js:435:10)
- at Request.self.callback (node_modules/request/request.js:187:22)
- at Request.<anonymous> (node_modules/request/request.js:1044:10)
- at IncomingMessage.<anonymous> (node_modules/request/request.js:965:12)
- at endReadableNT (_stream_readable.js:974:12)
- at _combinedTickCallback (internal/process/next_tick.js:74:11)
- at process._tickDomainCallback (internal/process/next_tick.js:122:9)
- 7) /users Get all users:
- Uncaught ReferenceError: done is not defined
- at test/products.js:51:9
- at verify (node_modules/hippie/lib/hippie/client.js:475:32)
- at statusCode (node_modules/hippie/lib/hippie/expect.js:23:5)
- at verify (node_modules/hippie/lib/hippie/client.js:476:5)
- at Client.verify (node_modules/hippie/lib/hippie/client.js:477:5)
- at node_modules/hippie/lib/hippie/client.js:437:12
- at Client.exports.json [as parse] (node_modules/hippie/lib/hippie/parsers.js:21:3)
- at Request._callback (node_modules/hippie/lib/hippie/client.js:435:10)
- at Request.self.callback (node_modules/request/request.js:187:22)
- at Request.<anonymous> (node_modules/request/request.js:1044:10)
- at IncomingMessage.<anonymous> (node_modules/request/request.js:965:12)
- at endReadableNT (_stream_readable.js:974:12)
- at _combinedTickCallback (internal/process/next_tick.js:74:11)
- at process._tickDomainCallback (internal/process/next_tick.js:122:9)
- 8) /users Look for an username:
- Uncaught AssertionError: Body
- Actual: [ { user_id: 1,
- username: 'test_user',
- password: '123',
- email: 'test@tset.nl',
- admin: 0,
- date_of_birth: '2000-10-10T00:00:00.000Z',
- create_date: '2017-01-27T00:00:00.000Z',
- boolean_deleted: 0,
- boolean_banned: 0,
- token: null } ]
- Expected: [ { user_id: 1,
- username: 'test_user',
- password: '123',
- email: 'test@tset.nl',
- admin: 0,
- date_of_birth: '2000-10-09T22:00:00.000Z',
- create_date: '2017-01-26T23:00:00.000Z',
- boolean_deleted: 0,
- boolean_banned: 0,
- token: null } ]
- at assert (node_modules/hippie/lib/hippie/assert.js:36:10)
- at value (node_modules/hippie/lib/hippie/expect.js:92:10)
- at verify (node_modules/hippie/lib/hippie/client.js:476:5)
- at statusCode (node_modules/hippie/lib/hippie/expect.js:23:5)
- at verify (node_modules/hippie/lib/hippie/client.js:476:5)
- at Client.verify (node_modules/hippie/lib/hippie/client.js:477:5)
- at node_modules/hippie/lib/hippie/client.js:437:12
- at Client.exports.json [as parse] (node_modules/hippie/lib/hippie/parsers.js:21:3)
- at Request._callback (node_modules/hippie/lib/hippie/client.js:435:10)
- at Request.self.callback (node_modules/request/request.js:187:22)
- at Request.<anonymous> (node_modules/request/request.js:1044:10)
- at IncomingMessage.<anonymous> (node_modules/request/request.js:965:12)
- at endReadableNT (_stream_readable.js:974:12)
- at _combinedTickCallback (internal/process/next_tick.js:74:11)
- at process._tickDomainCallback (internal/process/next_tick.js:122:9)
- 9) /users Look for an user with specific username/password:
- Uncaught AssertionError: Body
- Actual: [ { user_id: 1,
- username: 'test_user',
- password: '123',
- email: 'test@tset.nl',
- admin: 0,
- date_of_birth: '2000-10-10T00:00:00.000Z',
- create_date: '2017-01-27T00:00:00.000Z',
- boolean_deleted: 0,
- boolean_banned: 0,
- token: null } ]
- Expected: [ { user_id: 1,
- username: 'test_user',
- password: '123',
- email: 'test@tset.nl',
- admin: 0,
- date_of_birth: '2000-10-09T22:00:00.000Z',
- create_date: '2017-01-26T23:00:00.000Z',
- boolean_deleted: 0,
- boolean_banned: 0,
- token: null } ]
- at assert (node_modules/hippie/lib/hippie/assert.js:36:10)
- at value (node_modules/hippie/lib/hippie/expect.js:92:10)
- at verify (node_modules/hippie/lib/hippie/client.js:476:5)
- at statusCode (node_modules/hippie/lib/hippie/expect.js:23:5)
- at verify (node_modules/hippie/lib/hippie/client.js:476:5)
- at Client.verify (node_modules/hippie/lib/hippie/client.js:477:5)
- at node_modules/hippie/lib/hippie/client.js:437:12
- at Client.exports.json [as parse] (node_modules/hippie/lib/hippie/parsers.js:21:3)
- at Request._callback (node_modules/hippie/lib/hippie/client.js:435:10)
- at Request.self.callback (node_modules/request/request.js:187:22)
- at Request.<anonymous> (node_modules/request/request.js:1044:10)
- at IncomingMessage.<anonymous> (node_modules/request/request.js:965:12)
- at endReadableNT (_stream_readable.js:974:12)
- at _combinedTickCallback (internal/process/next_tick.js:74:11)
- at process._tickDomainCallback (internal/process/next_tick.js:122:9)
- 10) /users Update an user:
- Uncaught AssertionError: Body
- Actual: [ { user_id: 1,
- username: 'test_user',
- password: '123',
- email: 'test@tset.nl',
- admin: 0,
- date_of_birth: '2000-10-10T00:00:00.000Z',
- create_date: '2017-01-27T00:00:00.000Z',
- boolean_deleted: 0,
- boolean_banned: 0,
- token: null } ]
- Expected: [ { user_id: 1,
- username: 'test_user',
- password: '123',
- email: 'test@tset.nl',
- admin: 0,
- date_of_birth: '2000-10-09T22:00:00.000Z',
- create_date: '2017-01-26T23:00:00.000Z',
- boolean_deleted: 0,
- boolean_banned: 0,
- token: null } ]
- at assert (node_modules/hippie/lib/hippie/assert.js:36:10)
- at value (node_modules/hippie/lib/hippie/expect.js:92:10)
- at verify (node_modules/hippie/lib/hippie/client.js:476:5)
- at statusCode (node_modules/hippie/lib/hippie/expect.js:23:5)
- at verify (node_modules/hippie/lib/hippie/client.js:476:5)
- at Client.verify (node_modules/hippie/lib/hippie/client.js:477:5)
- at node_modules/hippie/lib/hippie/client.js:437:12
- at Client.exports.json [as parse] (node_modules/hippie/lib/hippie/parsers.js:21:3)
- at Request._callback (node_modules/hippie/lib/hippie/client.js:435:10)
- at Request.self.callback (node_modules/request/request.js:187:22)
- at Request.<anonymous> (node_modules/request/request.js:1044:10)
- at IncomingMessage.<anonymous> (node_modules/request/request.js:965:12)
- at endReadableNT (_stream_readable.js:974:12)
- at _combinedTickCallback (internal/process/next_tick.js:74:11)
- at process._tickDomainCallback (internal/process/next_tick.js:122:9)
- 11) /wishlist Get all products from an user wishlist:
- Uncaught AssertionError: Body
- Actual: [ { user_id: 26,
- product_id: 1,
- addition_date: '2017-01-30T00:00:00.000Z',
- hidden: 0,
- boolean_deleted: 0,
- p_name: 'test_product',
- p_description: 'This is a test product',
- p_price: '100',
- p_brand: 'brand',
- p_model: 'model',
- p_submodel: 'sub_model',
- p_color: 'color',
- p_construction_year: 2000,
- p_image: 'https://openclipart.org/image/2400px/svg_to_png/222252/feels.png' } ]
- Expected: [ { user_id: 26,
- product_id: 1,
- addition_date: '2017-01-29T23:00:00.000Z',
- hidden: 0,
- boolean_deleted: 0,
- p_name: 'test_product',
- p_description: 'This is a test product',
- p_price: '100',
- p_brand: 'brand',
- p_model: 'model',
- p_submodel: 'sub_model',
- p_color: 'color',
- p_construction_year: 2000,
- p_image: 'https://openclipart.org/image/2400px/svg_to_png/222252/feels.png' } ]
- at assert (node_modules/hippie/lib/hippie/assert.js:36:10)
- at value (node_modules/hippie/lib/hippie/expect.js:92:10)
- at verify (node_modules/hippie/lib/hippie/client.js:476:5)
- at statusCode (node_modules/hippie/lib/hippie/expect.js:23:5)
- at verify (node_modules/hippie/lib/hippie/client.js:476:5)
- at Client.verify (node_modules/hippie/lib/hippie/client.js:477:5)
- at node_modules/hippie/lib/hippie/client.js:437:12
- at Client.exports.json [as parse] (node_modules/hippie/lib/hippie/parsers.js:21:3)
- at Request._callback (node_modules/hippie/lib/hippie/client.js:435:10)
- at Request.self.callback (node_modules/request/request.js:187:22)
- at Request.<anonymous> (node_modules/request/request.js:1044:10)
- at IncomingMessage.<anonymous> (node_modules/request/request.js:965:12)
- at endReadableNT (_stream_readable.js:974:12)
- at _combinedTickCallback (internal/process/next_tick.js:74:11)
- at process._tickDomainCallback (internal/process/next_tick.js:122:9)
- 12) /wishlist See if a wish exists:
- Uncaught AssertionError: Body
- Actual: [ { user_id: 1,
- product_id: 2,
- addition_date: '2017-01-29T00:00:00.000Z',
- hidden: 0,
- boolean_deleted: 0 } ]
- Expected: [ { user_id: 1,
- product_id: 2,
- addition_date: '2017-01-28T23:00:00.000Z',
- hidden: 0,
- boolean_deleted: 0 } ]
- at assert (node_modules/hippie/lib/hippie/assert.js:36:10)
- at value (node_modules/hippie/lib/hippie/expect.js:92:10)
- at verify (node_modules/hippie/lib/hippie/client.js:476:5)
- at statusCode (node_modules/hippie/lib/hippie/expect.js:23:5)
- at verify (node_modules/hippie/lib/hippie/client.js:476:5)
- at Client.verify (node_modules/hippie/lib/hippie/client.js:477:5)
- at node_modules/hippie/lib/hippie/client.js:437:12
- at Client.exports.json [as parse] (node_modules/hippie/lib/hippie/parsers.js:21:3)
- at Request._callback (node_modules/hippie/lib/hippie/client.js:435:10)
- at Request.self.callback (node_modules/request/request.js:187:22)
- at Request.<anonymous> (node_modules/request/request.js:1044:10)
- at IncomingMessage.<anonymous> (node_modules/request/request.js:965:12)
- at endReadableNT (_stream_readable.js:974:12)
- at _combinedTickCallback (internal/process/next_tick.js:74:11)
- at process._tickDomainCallback (internal/process/next_tick.js:122:9)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement