I would like to advise if the following production code is good to be unit tested. The segment of  the production code gets data from a backend service and displays it on the page. It is a class:...// Extract this code into a separate method because it is called in more than 1 placeKeywords.prototype.addKeyword = function(keyword) {    $(ul).append(<li> + keyword + </li>);}// This is the method that I want to testKeywords.prototype.getKeywords = function(forGroup) {    // AppDao contains a bunch of methods that get data    var keywords = AppDao.getKeywords(forGroup),        that = this;    $.each(keywords, function(i, keyword) {        that.addKeyword(keyword);    };}...I'm planning to test it in the following way:Stub Keywords.prototype.addKeyword() and make sure that it will be called with 3 arguments: KW A, KW B, and KW CStub AppDao.getKeywords() and make sure that it will be called with Test Group and will return 3 keywords: KW A, KW B, and KW CInvoke Keywords.prototype.getKeywords() and verify the stubsI didn't start the actual implementation of the test yet because I would like to advise with you guys if you think that something can be better done. Thanks.
Production code to be good for unit testing
javascript;unit testing