I am writing a unit test for a controller where somewhere in the workflow 
checks the DOM for a specific property. Currently I am just mocking the 
method via 

spyOn(controller, 'methodChecksDom').return('value that I want').


Works fine but how do I make the test pass without mocking that method. 
I've tried using $document and actually inserting dom via

$document.find('body').append('<div>...</div>')


but I get the following error in my test:

Error: Dirty test! DOM residue found in document body: ... at Error (native)

What is the proper way of doing this. Testing the method without mocking 
it. Many Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to