mercredi 7 mars 2018

Can't find element when trying to send keyevent

In my integration test I can't seem to get a keyEvent to work at all. Specifically, I can't get the keyEvent to find any elements to register the keyEvent on at all.

test('Command + A selects all tags', function(assert){
  server.create('tag',{
    firstName: 'George',
    lastName: 'Washington'
  });
  server.create('tag',{
    firstName: 'Abe',
    lastName: 'Lincoln'
  });
  visit('/tags');
  keyEvent('#ember-testing', 'keydown', '65',{metaKey: true});
  andThen(()=>{
    assert.equal( find('.tag-component').length, 2 );
  });
});

I keep getting Uncaught Error: Element #ember-testing not found.

Ember      :    2.18.2
Ember Data :    2.18.2
jQuery     :    3.3.1




Aucun commentaire:

Enregistrer un commentaire