ng-clip icon indicating copy to clipboard operation
ng-clip copied to clipboard

Testing the module

Open BeOleg opened this issue 10 years ago • 2 comments

Hi Asaf, I am now writing tests for this module using mocha, the problem is that for the module to be testable the ZeroClipboard instances will have to be stored inside a service \ factory, in order to call the getText() method from the test(probably service...)

Now I am thinking about about a good way to implement this, and the only way I've been able to come up with so far is a hash map that will contain the zeroClipboard object as value, and the key will be the element id(not good, don't want to force the users to set an id attribute for the element they bind the plugin to)

Any ideas?

BeOleg avatar Jan 20 '14 20:01 BeOleg

Look at those ones: https://github.com/BeOleg/ng-clip/commit/c0e00da22bfa3e4da5d1f10bbbeacf7b741b99ea https://github.com/BeOleg/ng-clip/commit/6ebc0e37ecfa89092656e4c5dbd7b758a2a124b0

BeOleg avatar Jan 21 '14 08:01 BeOleg

https://github.com/zeroclipboard/zeroclipboard/issues/334

BeOleg avatar Jan 31 '14 09:01 BeOleg