Guest User

Untitled

a guest
Dec 21st, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. const chai = require('chai')
  2. chai.use(require('./node_modules/chai-like'))
  3. chai.use(require('./node_modules/chai-http'))
  4.  
  5. const { app, routes, users, deliveryReceipt } = require('../config')
  6. const { getApi, waitApi, wrapHttp, expectDefaultResponse, expectDefaultErrorResponse } = require('../helpers')
  7.  
  8. const { expect } = chai
  9.  
  10. describe('test Fuelling Additional Request No Percentage', () => {
  11. const afFlightApi = getApi(app.afBaseUrl).withPrefix(routes.flights)
  12.  
  13. let flightId = 'unspecified'
  14. let taskId = 'unspecified'
  15. let paymentDraftId = 'unspecified'
  16. let fuellingId = 'unspecified'
  17.  
  18. before(async () => {
  19. await Promise.all([afFlightApi.login(users.defaultAfUser)
  20. })
  21.  
  22. describe('when user create a new flight with name SU100', () => {
  23. it('it should success and create a task', async () => {
  24. const newTask = {
  25. reference: '№ 12324 от 25.03.2018',
  26. flight_id: flightId,
  27. order_id: orderId,
  28. vehicle_id: 'VH_45_FM_02',
  29. operator: {
  30. id: 'OPER_123',
  31. name: 'Петров Петр Петрович'
  32. }
  33. }
  34. const response = await wrapHttp(gpnTaskApi.post().send(newTask))
  35. expectDefaultResponse(response)
  36. const result = response.body.result
  37. expect(result).to.not.be.null
  38. taskId = result
  39. console.log(taskId)
  40. })
  41. })
  42. })
Advertisement
Add Comment
Please, Sign In to add comment