lundi 22 mai 2017

Ember Integration Test Component Within Component

I have installed ember-bootstrap in my application. Then, I created a login-form component.

In the app/templates/components/login-form.hbs, there are 2 Bootstrap input and 1 button, which are the following:


    
        <label for="email">Email</label>
        <input id="email" value= name="email" class="form-control" oninput= type="text" placeholder="Email" required>
    
    
        <label for="password">Password</label>
        <input id="password" value= name="password" class="form-control" oninput= type="password" placeholder="Password" required>
    
    


Edited test: When I do integration test in Components, it does not seem to identify this.

test('it renders', function(assert) {
  this.render(hbs``);
  assert.equal(this.$().text().trim(), '');
  assert.equal(this.$('input').attr('name'),'email','has Email');
  assert.equal(this.$('input').attr('name'),'password','has Password');
  assert.equal(this.$('button').text(),'Login','has Login');
});

In the input, I get undefined results. What is the proper way to call input for a form.group component in Bootstrap, to be used in the component testing?

Edited: Added screenshot enter image description here




Aucun commentaire:

Enregistrer un commentaire