{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/kibana/pulls/comments/74847763","id":74847763,"diff_hunk":"@@ -0,0 +1,107 @@\n+import expect from 'expect.js';\n+import sinon from 'sinon';\n+import monitorStateChanges from 'ui/state_management/monitor_changes';\n+import SimpleEmitter from 'ui/utils/SimpleEmitter';\n+\n+describe('monitorStateChanges', function () {\n+  const noop = () => {};\n+  const eventTypes = [\n+    'save_with_changes',\n+    'reset_with_changes',\n+    'fetch_with_changes',\n+  ];\n+  let mockState;\n+\n+  beforeEach(() => {\n+    mockState = new SimpleEmitter();\n+  });\n+\n+  describe('sanity checks', function () {","path":"src/ui/public/state_management/__tests__/monitor_changes.js","position":19,"original_position":19,"commit_id":"92c4f742f822098007de0a7bf2f49fc838f4a76b","original_commit_id":"92c4f742f822098007de0a7bf2f49fc838f4a76b","user":{"login":"w33ble","id":404731,"avatar_url":"https://avatars.githubusercontent.com/u/404731?v=3","gravatar_id":"","url":"https://api.github.com/users/w33ble","html_url":"https://github.com/w33ble","followers_url":"https://api.github.com/users/w33ble/followers","following_url":"https://api.github.com/users/w33ble/following{/other_user}","gists_url":"https://api.github.com/users/w33ble/gists{/gist_id}","starred_url":"https://api.github.com/users/w33ble/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/w33ble/subscriptions","organizations_url":"https://api.github.com/users/w33ble/orgs","repos_url":"https://api.github.com/users/w33ble/repos","events_url":"https://api.github.com/users/w33ble/events{/privacy}","received_events_url":"https://api.github.com/users/w33ble/received_events","type":"User","site_admin":false},"body":"I've never expected the `describe` suites to match up with the methods, it's just a way to organize the tests. Here, I'm checking that the argument enforcement works as expected, and that the method throws if you give it the wrong stuff. I could drop the grouping if the output really bothers you though, then you'd get:\r\n\r\n`monitorStateChanges should throw if not given a handler function`\r\n`monitorStateChanges should throw if not given a valid cleanup function`","created_at":"2016-08-15T22:32:16Z","updated_at":"2016-08-15T22:32:16Z","html_url":"https://github.com/elastic/kibana/pull/7984#discussion_r74847763","pull_request_url":"https://api.github.com/repos/elastic/kibana/pulls/7984","_links":{"self":{"href":"https://api.github.com/repos/elastic/kibana/pulls/comments/74847763"},"html":{"href":"https://github.com/elastic/kibana/pull/7984#discussion_r74847763"},"pull_request":{"href":"https://api.github.com/repos/elastic/kibana/pulls/7984"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/kibana/pulls/7984","id":81052742,"html_url":"https://github.com/elastic/kibana/pull/7984","diff_url":"https://github.com/elastic/kibana/pull/7984.diff","patch_url":"https://github.com/elastic/kibana/pull/7984.patch","issue_url":"https://api.github.com/repos/elastic/kibana/issues/7984","number":7984,"state":"open","locked":false,"title":"Add an appStatus to app controllers and scope","user":{"login":"w33ble","id":404731,"avatar_url":"https://avatars.githubusercontent.com/u/404731?v=3","gravatar_id":"","url":"https://api.github.com/users/w33ble","html_url":"https://github.com/w33ble","followers_url":"https://api.github.com/users/w33ble/followers","following_url":"https://api.github.com/users/w33ble/following{/other_user}","gists_url":"https://api.github.com/users/w33ble/gists{/gist_id}","starred_url":"https://api.github.com/users/w33ble/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/w33ble/subscriptions","organizations_url":"https://api.github.com/users/w33ble/orgs","repos_url":"https://api.github.com/users/w33ble/repos","events_url":"https://api.github.com/users/w33ble/events{/privacy}","received_events_url":"https://api.github.com/users/w33ble/received_events","type":"User","site_admin":false},"body":"This PR adds an `appStatus` to the controller and scopes for Discover, Visualize and Dashboard. It uses this status to track whether or not the app is \"dirty\", that is, if it has been modified since it was last saved.\r\n\r\n- Add state monitoring module\r\n- Refactor Discover and Visualize into directives\r\n- Add dirty checking to apps based on `appState`, and in the case of Visualize, `editableVis` as well\r\n- Fix `config` rendering, firing postLink after injecting in the DOM so that directives with a `require` will function","created_at":"2016-08-12T00:29:01Z","updated_at":"2016-08-15T22:32:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ec07145a6a4e1c6844fe8417145fd4c6f6346b85","assignee":{"login":"tylersmalley","id":40265,"avatar_url":"https://avatars.githubusercontent.com/u/40265?v=3","gravatar_id":"","url":"https://api.github.com/users/tylersmalley","html_url":"https://github.com/tylersmalley","followers_url":"https://api.github.com/users/tylersmalley/followers","following_url":"https://api.github.com/users/tylersmalley/following{/other_user}","gists_url":"https://api.github.com/users/tylersmalley/gists{/gist_id}","starred_url":"https://api.github.com/users/tylersmalley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tylersmalley/subscriptions","organizations_url":"https://api.github.com/users/tylersmalley/orgs","repos_url":"https://api.github.com/users/tylersmalley/repos","events_url":"https://api.github.com/users/tylersmalley/events{/privacy}","received_events_url":"https://api.github.com/users/tylersmalley/received_events","type":"User","site_admin":false},"assignees":[{"login":"tylersmalley","id":40265,"avatar_url":"https://avatars.githubusercontent.com/u/40265?v=3","gravatar_id":"","url":"https://api.github.com/users/tylersmalley","html_url":"https://github.com/tylersmalley","followers_url":"https://api.github.com/users/tylersmalley/followers","following_url":"https://api.github.com/users/tylersmalley/following{/other_user}","gists_url":"https://api.github.com/users/tylersmalley/gists{/gist_id}","starred_url":"https://api.github.com/users/tylersmalley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tylersmalley/subscriptions","organizations_url":"https://api.github.com/users/tylersmalley/orgs","repos_url":"https://api.github.com/users/tylersmalley/repos","events_url":"https://api.github.com/users/tylersmalley/events{/privacy}","received_events_url":"https://api.github.com/users/tylersmalley/received_events","type":"User","site_admin":false},{"login":"cjcenizal","id":1238659,"avatar_url":"https://avatars.githubusercontent.com/u/1238659?v=3","gravatar_id":"","url":"https://api.github.com/users/cjcenizal","html_url":"https://github.com/cjcenizal","followers_url":"https://api.github.com/users/cjcenizal/followers","following_url":"https://api.github.com/users/cjcenizal/following{/other_user}","gists_url":"https://api.github.com/users/cjcenizal/gists{/gist_id}","starred_url":"https://api.github.com/users/cjcenizal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjcenizal/subscriptions","organizations_url":"https://api.github.com/users/cjcenizal/orgs","repos_url":"https://api.github.com/users/cjcenizal/repos","events_url":"https://api.github.com/users/cjcenizal/events{/privacy}","received_events_url":"https://api.github.com/users/cjcenizal/received_events","type":"User","site_admin":false},{"login":"spalger","id":1329312,"avatar_url":"https://avatars.githubusercontent.com/u/1329312?v=3","gravatar_id":"","url":"https://api.github.com/users/spalger","html_url":"https://github.com/spalger","followers_url":"https://api.github.com/users/spalger/followers","following_url":"https://api.github.com/users/spalger/following{/other_user}","gists_url":"https://api.github.com/users/spalger/gists{/gist_id}","starred_url":"https://api.github.com/users/spalger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spalger/subscriptions","organizations_url":"https://api.github.com/users/spalger/orgs","repos_url":"https://api.github.com/users/spalger/repos","events_url":"https://api.github.com/users/spalger/events{/privacy}","received_events_url":"https://api.github.com/users/spalger/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/elastic/kibana/pulls/7984/commits","review_comments_url":"https://api.github.com/repos/elastic/kibana/pulls/7984/comments","review_comment_url":"https://api.github.com/repos/elastic/kibana/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/kibana/issues/7984/comments","statuses_url":"https://api.github.com/repos/elastic/kibana/statuses/92c4f742f822098007de0a7bf2f49fc838f4a76b","head":{"label":"w33ble:enhancement/app-status-dirty","ref":"enhancement/app-status-dirty","sha":"92c4f742f822098007de0a7bf2f49fc838f4a76b","user":{"login":"w33ble","id":404731,"avatar_url":"https://avatars.githubusercontent.com/u/404731?v=3","gravatar_id":"","url":"https://api.github.com/users/w33ble","html_url":"https://github.com/w33ble","followers_url":"https://api.github.com/users/w33ble/followers","following_url":"https://api.github.com/users/w33ble/following{/other_user}","gists_url":"https://api.github.com/users/w33ble/gists{/gist_id}","starred_url":"https://api.github.com/users/w33ble/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/w33ble/subscriptions","organizations_url":"https://api.github.com/users/w33ble/orgs","repos_url":"https://api.github.com/users/w33ble/repos","events_url":"https://api.github.com/users/w33ble/events{/privacy}","received_events_url":"https://api.github.com/users/w33ble/received_events","type":"User","site_admin":false},"repo":{"id":21840088,"name":"kibana","full_name":"w33ble/kibana","owner":{"login":"w33ble","id":404731,"avatar_url":"https://avatars.githubusercontent.com/u/404731?v=3","gravatar_id":"","url":"https://api.github.com/users/w33ble","html_url":"https://github.com/w33ble","followers_url":"https://api.github.com/users/w33ble/followers","following_url":"https://api.github.com/users/w33ble/following{/other_user}","gists_url":"https://api.github.com/users/w33ble/gists{/gist_id}","starred_url":"https://api.github.com/users/w33ble/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/w33ble/subscriptions","organizations_url":"https://api.github.com/users/w33ble/orgs","repos_url":"https://api.github.com/users/w33ble/repos","events_url":"https://api.github.com/users/w33ble/events{/privacy}","received_events_url":"https://api.github.com/users/w33ble/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/w33ble/kibana","description":"Kibana","fork":true,"url":"https://api.github.com/repos/w33ble/kibana","forks_url":"https://api.github.com/repos/w33ble/kibana/forks","keys_url":"https://api.github.com/repos/w33ble/kibana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/w33ble/kibana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/w33ble/kibana/teams","hooks_url":"https://api.github.com/repos/w33ble/kibana/hooks","issue_events_url":"https://api.github.com/repos/w33ble/kibana/issues/events{/number}","events_url":"https://api.github.com/repos/w33ble/kibana/events","assignees_url":"https://api.github.com/repos/w33ble/kibana/assignees{/user}","branches_url":"https://api.github.com/repos/w33ble/kibana/branches{/branch}","tags_url":"https://api.github.com/repos/w33ble/kibana/tags","blobs_url":"https://api.github.com/repos/w33ble/kibana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/w33ble/kibana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/w33ble/kibana/git/refs{/sha}","trees_url":"https://api.github.com/repos/w33ble/kibana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/w33ble/kibana/statuses/{sha}","languages_url":"https://api.github.com/repos/w33ble/kibana/languages","stargazers_url":"https://api.github.com/repos/w33ble/kibana/stargazers","contributors_url":"https://api.github.com/repos/w33ble/kibana/contributors","subscribers_url":"https://api.github.com/repos/w33ble/kibana/subscribers","subscription_url":"https://api.github.com/repos/w33ble/kibana/subscription","commits_url":"https://api.github.com/repos/w33ble/kibana/commits{/sha}","git_commits_url":"https://api.github.com/repos/w33ble/kibana/git/commits{/sha}","comments_url":"https://api.github.com/repos/w33ble/kibana/comments{/number}","issue_comment_url":"https://api.github.com/repos/w33ble/kibana/issues/comments{/number}","contents_url":"https://api.github.com/repos/w33ble/kibana/contents/{+path}","compare_url":"https://api.github.com/repos/w33ble/kibana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/w33ble/kibana/merges","archive_url":"https://api.github.com/repos/w33ble/kibana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/w33ble/kibana/downloads","issues_url":"https://api.github.com/repos/w33ble/kibana/issues{/number}","pulls_url":"https://api.github.com/repos/w33ble/kibana/pulls{/number}","milestones_url":"https://api.github.com/repos/w33ble/kibana/milestones{/number}","notifications_url":"https://api.github.com/repos/w33ble/kibana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/w33ble/kibana/labels{/name}","releases_url":"https://api.github.com/repos/w33ble/kibana/releases{/id}","deployments_url":"https://api.github.com/repos/w33ble/kibana/deployments","created_at":"2014-07-14T23:59:39Z","updated_at":"2016-02-12T18:53:11Z","pushed_at":"2016-08-12T21:12:13Z","git_url":"git://github.com/w33ble/kibana.git","ssh_url":"git@github.com:w33ble/kibana.git","clone_url":"https://github.com/w33ble/kibana.git","svn_url":"https://github.com/w33ble/kibana","homepage":"http://www.elasticsearch.org/overview/kibana/","size":182369,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"elastic:4.x","ref":"4.x","sha":"28682338da378ced6934e8d6b741cb70b5de8565","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":7833168,"name":"kibana","full_name":"elastic/kibana","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/kibana","description":":bar_chart: Kibana analytics and search dashboard for Elasticsearch","fork":false,"url":"https://api.github.com/repos/elastic/kibana","forks_url":"https://api.github.com/repos/elastic/kibana/forks","keys_url":"https://api.github.com/repos/elastic/kibana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/kibana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/kibana/teams","hooks_url":"https://api.github.com/repos/elastic/kibana/hooks","issue_events_url":"https://api.github.com/repos/elastic/kibana/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/kibana/events","assignees_url":"https://api.github.com/repos/elastic/kibana/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/kibana/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/kibana/tags","blobs_url":"https://api.github.com/repos/elastic/kibana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/kibana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/kibana/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/kibana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/kibana/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/kibana/languages","stargazers_url":"https://api.github.com/repos/elastic/kibana/stargazers","contributors_url":"https://api.github.com/repos/elastic/kibana/contributors","subscribers_url":"https://api.github.com/repos/elastic/kibana/subscribers","subscription_url":"https://api.github.com/repos/elastic/kibana/subscription","commits_url":"https://api.github.com/repos/elastic/kibana/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/kibana/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/kibana/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/kibana/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/kibana/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/kibana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/kibana/merges","archive_url":"https://api.github.com/repos/elastic/kibana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/kibana/downloads","issues_url":"https://api.github.com/repos/elastic/kibana/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/kibana/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/kibana/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/kibana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/kibana/labels{/name}","releases_url":"https://api.github.com/repos/elastic/kibana/releases{/id}","deployments_url":"https://api.github.com/repos/elastic/kibana/deployments","created_at":"2013-01-26T04:00:59Z","updated_at":"2016-08-15T21:14:40Z","pushed_at":"2016-08-15T19:47:44Z","git_url":"git://github.com/elastic/kibana.git","ssh_url":"git@github.com:elastic/kibana.git","clone_url":"https://github.com/elastic/kibana.git","svn_url":"https://github.com/elastic/kibana","homepage":"https://www.elastic.co/products/kibana","size":264523,"stargazers_count":5821,"watchers_count":5821,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2138,"mirror_url":null,"open_issues_count":1156,"forks":2138,"open_issues":1156,"watchers":5821,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/kibana/pulls/7984"},"html":{"href":"https://github.com/elastic/kibana/pull/7984"},"issue":{"href":"https://api.github.com/repos/elastic/kibana/issues/7984"},"comments":{"href":"https://api.github.com/repos/elastic/kibana/issues/7984/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/kibana/pulls/7984/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/kibana/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/kibana/pulls/7984/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/kibana/statuses/92c4f742f822098007de0a7bf2f49fc838f4a76b"}}}}
{"actor":{"display_login":"w33ble"}}