0

component html file part where request is being send

       <paper-button class="indigo" style="margin-top:1em; width:15%" 
        on-tap="sendLoginRequest">Login</paper-button>
         <iron-ajax id="loginAjaxRequest" handle-as="json" on- 
     response="loginResponse" on-error="showToast"></iron-ajax>

sendloginRequest function part where request is fired

        sendLoginRequest() {
         //some code
   this.$.loginAjaxRequest.url = "http://localhost:8080/api/login"
    this.$.loginAjaxRequest.body = JSON.stringify(loginJson)
    this.$.loginAjaxRequest.method = "POST"
    this.$.loginAjaxRequest.generateRequest()
  }

how to write test cases for it

learning code
  • 11
  • 1
  • 7
  • Please be more specific in the question. What type of tests, ect. –  Sep 20 '18 at 17:05
  • writing wct tests – learning code Sep 20 '18 at 18:45
  • i am getting these kind of logs after runnning polymer test command Failed to load resource: the server responded with a status of 404 (Not Found) :8081/bower_components/scheduler-component/scheduler-component.html:1 Failed to load resource: the server responded with a status of 404 (Not Found) :8081/bower_components/paper-dialog/paper-dialog.html:1 Failed to load resource: the server responded with a status of 404 (Not Found) :8081/bower_components/paper-input/paper-input.html:1 Failed to load resource: the server responded with a status of 404 (Not Found) – learning code Sep 20 '18 at 18:54
  • Alright well you are going to have to double check your paths and other data you put in for your requests. You haven't put in enough information to give a proper answer to your question. You should probably use a simple case scenario that reproduces the error. –  Sep 20 '18 at 19:00
  • Maybe you'll be able to resolve it on your own if you did. –  Sep 20 '18 at 19:01

0 Answers0