1

I'm trying to write a test for an AngularJS directive that fixes the browser autofill form issue (where AngularJS doesn't know any data is in the form if the browser has autofilled it as the onchange isn't triggered)

The actual code I'm using for the fix is at: https://stackoverflow.com/a/21073094/1219336

However, I want to test this code to make sure it's doing what I expect, which is after the browser autofills a form then angular can access the value.

The key issue is in mocha (using karma as test runner + phantomjs) how do i fake the form in my test to have a browser auto filled value.

If I just put a hard coded value in the test then the directive isn't really tested.

Any ideas?

Thanks

Community
  • 1
  • 1
TheStoneFox
  • 3,007
  • 3
  • 31
  • 47

0 Answers0