Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- myfile.html-->
- Keyword: <input type = "text" /><br/>
- Country:<select>
- <option>--Select Country--</option>
- <option>....</option>
- </select>
- <button btn btn-primary ng-click = 'search()'>Search</button>
- <button btn btn-primary>clear</button>
- <!------- end of html ---->
- //search.spec.js
- describe("search spec or whatever", function(){
- //.... some code here
- var keyword, country,URL = "http://localhost/appname";
- //... some more codes here
- it('should retrieve the search results', function (){
- keyword = 'keyword';
- country = 'mycountry';
- // I also want to check whether the user has clicked the button search how do I do it? expect (button.submit).click();???
- // assume that the user enters keyword in the text box and selects mycountry from the dropdownlist box.
- //so when the user clicks search the url will be of this form and how do I need write unit test case here?
- var serv_res = $httpBackend.When('GET", URL + '?keyword =' + keyword + '&country = ' + country);
- // so here what my expectations should be?
- });
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement