{"action":"created","issue":{"url":"https://api.github.com/repos/angular-ui/ui-mention/issues/11","labels_url":"https://api.github.com/repos/angular-ui/ui-mention/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/ui-mention/issues/11/comments","events_url":"https://api.github.com/repos/angular-ui/ui-mention/issues/11/events","html_url":"https://github.com/angular-ui/ui-mention/pull/11","id":102178585,"number":11,"title":"feat(tests): unit all the tests","user":{"login":"kasperlewau","id":2687184,"avatar_url":"https://avatars.githubusercontent.com/u/2687184?v=3","gravatar_id":"","url":"https://api.github.com/users/kasperlewau","html_url":"https://github.com/kasperlewau","followers_url":"https://api.github.com/users/kasperlewau/followers","following_url":"https://api.github.com/users/kasperlewau/following{/other_user}","gists_url":"https://api.github.com/users/kasperlewau/gists{/gist_id}","starred_url":"https://api.github.com/users/kasperlewau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasperlewau/subscriptions","organizations_url":"https://api.github.com/users/kasperlewau/orgs","repos_url":"https://api.github.com/users/kasperlewau/repos","events_url":"https://api.github.com/users/kasperlewau/events{/privacy}","received_events_url":"https://api.github.com/users/kasperlewau/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-20T16:35:08Z","updated_at":"2015-08-20T22:11:45Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/angular-ui/ui-mention/pulls/11","html_url":"https://github.com/angular-ui/ui-mention/pull/11","diff_url":"https://github.com/angular-ui/ui-mention/pull/11.diff","patch_url":"https://github.com/angular-ui/ui-mention/pull/11.patch"},"body":"* Split controller to separate file. \r\n  * Easier to reason about in tests.\r\n  * Easier on the end user should he/she want to modify/extend said controller. \r\n* Add `gulp karma #single-run` \r\n* Add `gulp watch:karma #no-single-run` \r\n\r\n--- \r\n\r\nSome issues/possible issues I found (read: created) while having some fun with tests; \r\n\r\n### implementation\r\n> I suppose the below points (barring the first) could all be design choices for all I know. Though the JSDOC would suggest otherwise. \r\n\r\n* module definition should probably happen in its own file now that there are multiple ones (opinion).\r\n* choice is not ensured in this.highligt.\r\n* choice is not ensured to follow the correct structure in this.label.\r\n* choice is not ensured in this.encode. \r\n* choice is not ensured to follow the correct structure in this.encode.\r\n* match is not ensured to be a regex.exec() in this.search.\r\n\r\n### specs\r\n* `ctrlInstance` is a sh*tty name. *why did I go there.*\r\n  * `$mention`? \r\n  * `Subject`?\r\n  * `ctrl`? \r\n* Lines 294-317 of `mentionController.es6` are completely untested.\r\n* keyboard events s-ck in phantomjs (switch to browser launchers?)\r\n* `$element.scrollHeight` testing is sort of wonky.\r\n* A lot of the tests could *probably* be simplified with the help of some more ES6.\r\n\r\n### build\r\n* Multiple `use stricts` s-ck, **\"Gee, thanks kasper...\"**\r\n\r\n--- \r\n\r\nFigured I'd post this before spending *too* much time on taking care of the aforementioned points. Not even certain you would want to roll Mocha > Jasmine, so this may all have been a couple of hours of all-fun no-work. I'm cool with that!\r\n\r\n> Ain't nobody got time for that.\r\n\r\nbut but, I like testing... :hushed: "},"comment":{"url":"https://api.github.com/repos/angular-ui/ui-mention/issues/comments/133193933","html_url":"https://github.com/angular-ui/ui-mention/pull/11#issuecomment-133193933","issue_url":"https://api.github.com/repos/angular-ui/ui-mention/issues/11","id":133193933,"user":{"login":"kasperlewau","id":2687184,"avatar_url":"https://avatars.githubusercontent.com/u/2687184?v=3","gravatar_id":"","url":"https://api.github.com/users/kasperlewau","html_url":"https://github.com/kasperlewau","followers_url":"https://api.github.com/users/kasperlewau/followers","following_url":"https://api.github.com/users/kasperlewau/following{/other_user}","gists_url":"https://api.github.com/users/kasperlewau/gists{/gist_id}","starred_url":"https://api.github.com/users/kasperlewau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasperlewau/subscriptions","organizations_url":"https://api.github.com/users/kasperlewau/orgs","repos_url":"https://api.github.com/users/kasperlewau/repos","events_url":"https://api.github.com/users/kasperlewau/events{/privacy}","received_events_url":"https://api.github.com/users/kasperlewau/received_events","type":"User","site_admin":false},"created_at":"2015-08-20T22:11:45Z","updated_at":"2015-08-20T22:11:45Z","body":"Doing a quick sanity check before going to bed here. Some of the tests are malicious in that they create expectations on the internal dependency between the exposed API methods. \r\n\r\nWhich is not good as it:\r\n\r\n* Is brittle. \r\n* Makes any sort of refactor harder. \r\n\r\ninput and ouput is the name of the game. Anything inbetween is silly. I'll give the suite a touch up in the morning. "}}