{"action":"created","comment":{"url":"https://api.github.com/repos/juju/juju-gui/pulls/comments/76638844","id":76638844,"diff_hunk":"@@ -292,171 +278,6 @@ describe('UserProfileModelList', () => {\n     assert.isUndefined(output.props.children[0].props.children[2]);\n   });\n \n-  it('creates then switches to newly created models', () => {\n-    // This test doesn't check the user interactions and animations, that\n-    // will need to be done with the uitest suite.\n-    var showConnectingMask = sinon.stub();\n-    var switchModel = sinon.stub();\n-    var component = jsTestUtils.shallowRender(\n-      <juju.components.UserProfileModelList\n-        addNotification={sinon.stub()}\n-        canCreateNew={true}\n-        controllerAPI={controllerAPI}\n-        hideConnectingMask={sinon.stub()}\n-        listModels={sinon.stub().callsArgWith(0, null, {models: models})}\n-        showConnectingMask={showConnectingMask}\n-        switchModel={switchModel}\n-        users={users}\n-        user={users.charmstore} />, true);\n-    var output = component.getRenderOutput();\n-    var instance = component.getMountedInstance();\n-    // Set up the component to simulate user action.\n-    instance.refs = {\n-      modelName: {\n-        validate: _ => true,\n-        getValue: _ => 'newmodelname'\n-      }\n-    };\n-    var preventable = { preventDefault: sinon.stub() };\n-    // Call the action method in the proper element.\n-    output.props.children[0].props.children[2].props.children.props.children[2]\n-      .props.action(preventable);\n-    assert.equal(preventable.preventDefault.callCount, 1,\n-                 'default not prevented');\n-    assert.equal(showConnectingMask.callCount, 1, 'mask not shown');\n-    // Make sure that it switches to the model after it's created.\n-    assert.equal(switchModel.callCount, 1, 'model not switched to');\n-    assert.equal(switchModel.args[0][0], 'abc123', 'uuid not passed through');\n-    assert.equal(switchModel.args[0][2], 'newmodelname', 'model name not set');\n-  });\n-\n-  it('does not submit to create new if name does not validate', () => {\n-    // This test doesn't check the user interactions and animations, that\n-    // will need to be done with the uitest suite.\n-    var showConnectingMask = sinon.stub();\n-    var switchModel = sinon.stub();\n-    var component = jsTestUtils.shallowRender(\n-      <juju.components.UserProfileModelList\n-        addNotification={sinon.stub()}\n-        canCreateNew={true}\n-        controllerAPI={controllerAPI}\n-        hideConnectingMask={sinon.stub()}\n-        listModels={sinon.stub().callsArgWith(0, null, {models: models})}\n-        showConnectingMask={showConnectingMask}\n-        switchModel={switchModel}\n-        users={users}\n-        user={users.charmstore} />, true);\n-    var output = component.getRenderOutput();\n-    var instance = component.getMountedInstance();\n-    // Set up the component to simulate user action.\n-    instance.refs = {\n-      modelName: {\n-        validate: _ => false\n-      }\n-    };\n-    var preventable = { preventDefault: sinon.stub() };\n-    // Call the action method in the proper element.\n-    output.props.children[0].props.children[2].props.children.props.children[2]\n-      .props.action(preventable);\n-    assert.equal(\n-      preventable.preventDefault.callCount, 1, 'default not prevented');\n-    assert.equal(showConnectingMask.callCount, 0, 'mask shown');\n-    // Make sure that it switches to the model after it's created.\n-    assert.equal(switchModel.callCount, 0, 'model should not be switched to');\n-  });\n-\n-  it('gracefully handles errors when creating new model', () => {\n-    // This test doesn't check the user interactions and animations, that\n-    // will need to be done with the uitest suite.\n-    controllerAPI.createModel = (modelName, userName, callback) => {\n-      assert.equal(modelName, 'newmodelname', 'model name not set properly');\n-      assert.equal(userName, 'test-owner', 'user name not set properly');\n-      // Simulate the model being created.\n-      callback({\n-        err: 'this is an error',\n-        uuid: 'abc123',\n-        name: modelName\n-      });\n-    };\n-    var hideConnectingMask = sinon.stub();\n-    var addNotification = sinon.stub();\n-    var component = jsTestUtils.shallowRender(\n-      <juju.components.UserProfileModelList\n-        addNotification={addNotification}\n-        canCreateNew={true}\n-        controllerAPI={controllerAPI}\n-        hideConnectingMask={hideConnectingMask}\n-        listModels={sinon.stub().callsArgWith(0, null, {models: models})}\n-        showConnectingMask={sinon.stub()}\n-        switchModel={sinon.stub()}\n-        users={users}\n-        user={users.charmstore} />, true);\n-    var output = component.getRenderOutput();\n-    var instance = component.getMountedInstance();\n-    // Set up the component to simulate user action.\n-    instance.refs = {\n-      modelName: {\n-        validate: _ => true,\n-        getValue: _ => 'newmodelname'\n-      }\n-    };\n-    var preventable = { preventDefault: sinon.stub() };\n-    // Call the action method in the proper element.\n-    output.props.children[0].props.children[2].props.children.props.children[2]\n-      .props.action(preventable);\n-    // Make sure that the mask is hidden and that a notification was added\n-    // with the error message.\n-    assert.equal(hideConnectingMask.callCount, 1, 'mask not hidden');\n-    assert.equal(addNotification.callCount, 1, 'notification not added');\n-    assert.deepEqual(addNotification.args[0][0], {\n-      title: 'Failed to create new Model',\n-      message: 'this is an error',\n-      level: 'error'\n-    });\n-  });\n-\n-  it('swtches models by switching to disconnected with JIMM', () => {","path":"jujugui/static/gui/src/app/components/user-profile/model-list/test-model-list.js","position":190,"original_position":190,"commit_id":"420a5edfe480487ddf6f1b78ab0e68a573cefadb","original_commit_id":"420a5edfe480487ddf6f1b78ab0e68a573cefadb","user":{"login":"kadams54","id":378036,"avatar_url":"https://avatars.githubusercontent.com/u/378036?v=3","gravatar_id":"","url":"https://api.github.com/users/kadams54","html_url":"https://github.com/kadams54","followers_url":"https://api.github.com/users/kadams54/followers","following_url":"https://api.github.com/users/kadams54/following{/other_user}","gists_url":"https://api.github.com/users/kadams54/gists{/gist_id}","starred_url":"https://api.github.com/users/kadams54/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kadams54/subscriptions","organizations_url":"https://api.github.com/users/kadams54/orgs","repos_url":"https://api.github.com/users/kadams54/repos","events_url":"https://api.github.com/users/kadams54/events{/privacy}","received_events_url":"https://api.github.com/users/kadams54/received_events","type":"User","site_admin":false},"body":"Yeah, this test almost entirely duplicates other tests, so I ended up leaving it out of the new test suites.","created_at":"2016-08-29T16:30:36Z","updated_at":"2016-08-29T16:30:36Z","html_url":"https://github.com/juju/juju-gui/pull/1949#discussion_r76638844","pull_request_url":"https://api.github.com/repos/juju/juju-gui/pulls/1949","_links":{"self":{"href":"https://api.github.com/repos/juju/juju-gui/pulls/comments/76638844"},"html":{"href":"https://github.com/juju/juju-gui/pull/1949#discussion_r76638844"},"pull_request":{"href":"https://api.github.com/repos/juju/juju-gui/pulls/1949"}}},"pull_request":{"url":"https://api.github.com/repos/juju/juju-gui/pulls/1949","id":82560051,"html_url":"https://github.com/juju/juju-gui/pull/1949","diff_url":"https://github.com/juju/juju-gui/pull/1949.diff","patch_url":"https://github.com/juju/juju-gui/pull/1949.patch","issue_url":"https://api.github.com/repos/juju/juju-gui/issues/1949","number":1949,"state":"open","locked":false,"title":"Add \"Create New Model\" button to the empty user profile.","user":{"login":"kadams54","id":378036,"avatar_url":"https://avatars.githubusercontent.com/u/378036?v=3","gravatar_id":"","url":"https://api.github.com/users/kadams54","html_url":"https://github.com/kadams54","followers_url":"https://api.github.com/users/kadams54/followers","following_url":"https://api.github.com/users/kadams54/following{/other_user}","gists_url":"https://api.github.com/users/kadams54/gists{/gist_id}","starred_url":"https://api.github.com/users/kadams54/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kadams54/subscriptions","organizations_url":"https://api.github.com/users/kadams54/orgs","repos_url":"https://api.github.com/users/kadams54/repos","events_url":"https://api.github.com/users/kadams54/events{/privacy}","received_events_url":"https://api.github.com/users/kadams54/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-24T15:05:59Z","updated_at":"2016-08-29T16:30:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fd9ec8eb68da4b861c82c97403c4b193bea272f5","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/juju/juju-gui/milestones/12","html_url":"https://github.com/juju/juju-gui/milestones/2.1.11","labels_url":"https://api.github.com/repos/juju/juju-gui/milestones/12/labels","id":1939301,"number":12,"title":"2.1.11","description":"","creator":{"login":"hatched","id":532033,"avatar_url":"https://avatars.githubusercontent.com/u/532033?v=3","gravatar_id":"","url":"https://api.github.com/users/hatched","html_url":"https://github.com/hatched","followers_url":"https://api.github.com/users/hatched/followers","following_url":"https://api.github.com/users/hatched/following{/other_user}","gists_url":"https://api.github.com/users/hatched/gists{/gist_id}","starred_url":"https://api.github.com/users/hatched/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hatched/subscriptions","organizations_url":"https://api.github.com/users/hatched/orgs","repos_url":"https://api.github.com/users/hatched/repos","events_url":"https://api.github.com/users/hatched/events{/privacy}","received_events_url":"https://api.github.com/users/hatched/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":24,"state":"open","created_at":"2016-08-12T16:28:52Z","updated_at":"2016-08-25T23:40:30Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/juju/juju-gui/pulls/1949/commits","review_comments_url":"https://api.github.com/repos/juju/juju-gui/pulls/1949/comments","review_comment_url":"https://api.github.com/repos/juju/juju-gui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/juju/juju-gui/issues/1949/comments","statuses_url":"https://api.github.com/repos/juju/juju-gui/statuses/420a5edfe480487ddf6f1b78ab0e68a573cefadb","head":{"label":"kadams54:add-counts-to-profile","ref":"add-counts-to-profile","sha":"420a5edfe480487ddf6f1b78ab0e68a573cefadb","user":{"login":"kadams54","id":378036,"avatar_url":"https://avatars.githubusercontent.com/u/378036?v=3","gravatar_id":"","url":"https://api.github.com/users/kadams54","html_url":"https://github.com/kadams54","followers_url":"https://api.github.com/users/kadams54/followers","following_url":"https://api.github.com/users/kadams54/following{/other_user}","gists_url":"https://api.github.com/users/kadams54/gists{/gist_id}","starred_url":"https://api.github.com/users/kadams54/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kadams54/subscriptions","organizations_url":"https://api.github.com/users/kadams54/orgs","repos_url":"https://api.github.com/users/kadams54/repos","events_url":"https://api.github.com/users/kadams54/events{/privacy}","received_events_url":"https://api.github.com/users/kadams54/received_events","type":"User","site_admin":false},"repo":{"id":17426336,"name":"juju-gui","full_name":"kadams54/juju-gui","owner":{"login":"kadams54","id":378036,"avatar_url":"https://avatars.githubusercontent.com/u/378036?v=3","gravatar_id":"","url":"https://api.github.com/users/kadams54","html_url":"https://github.com/kadams54","followers_url":"https://api.github.com/users/kadams54/followers","following_url":"https://api.github.com/users/kadams54/following{/other_user}","gists_url":"https://api.github.com/users/kadams54/gists{/gist_id}","starred_url":"https://api.github.com/users/kadams54/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kadams54/subscriptions","organizations_url":"https://api.github.com/users/kadams54/orgs","repos_url":"https://api.github.com/users/kadams54/repos","events_url":"https://api.github.com/users/kadams54/events{/privacy}","received_events_url":"https://api.github.com/users/kadams54/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kadams54/juju-gui","description":"Juju-GUI is a web-based GUI for Juju <https://juju.ubuntu.com/>.","fork":true,"url":"https://api.github.com/repos/kadams54/juju-gui","forks_url":"https://api.github.com/repos/kadams54/juju-gui/forks","keys_url":"https://api.github.com/repos/kadams54/juju-gui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kadams54/juju-gui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kadams54/juju-gui/teams","hooks_url":"https://api.github.com/repos/kadams54/juju-gui/hooks","issue_events_url":"https://api.github.com/repos/kadams54/juju-gui/issues/events{/number}","events_url":"https://api.github.com/repos/kadams54/juju-gui/events","assignees_url":"https://api.github.com/repos/kadams54/juju-gui/assignees{/user}","branches_url":"https://api.github.com/repos/kadams54/juju-gui/branches{/branch}","tags_url":"https://api.github.com/repos/kadams54/juju-gui/tags","blobs_url":"https://api.github.com/repos/kadams54/juju-gui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kadams54/juju-gui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kadams54/juju-gui/git/refs{/sha}","trees_url":"https://api.github.com/repos/kadams54/juju-gui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kadams54/juju-gui/statuses/{sha}","languages_url":"https://api.github.com/repos/kadams54/juju-gui/languages","stargazers_url":"https://api.github.com/repos/kadams54/juju-gui/stargazers","contributors_url":"https://api.github.com/repos/kadams54/juju-gui/contributors","subscribers_url":"https://api.github.com/repos/kadams54/juju-gui/subscribers","subscription_url":"https://api.github.com/repos/kadams54/juju-gui/subscription","commits_url":"https://api.github.com/repos/kadams54/juju-gui/commits{/sha}","git_commits_url":"https://api.github.com/repos/kadams54/juju-gui/git/commits{/sha}","comments_url":"https://api.github.com/repos/kadams54/juju-gui/comments{/number}","issue_comment_url":"https://api.github.com/repos/kadams54/juju-gui/issues/comments{/number}","contents_url":"https://api.github.com/repos/kadams54/juju-gui/contents/{+path}","compare_url":"https://api.github.com/repos/kadams54/juju-gui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kadams54/juju-gui/merges","archive_url":"https://api.github.com/repos/kadams54/juju-gui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kadams54/juju-gui/downloads","issues_url":"https://api.github.com/repos/kadams54/juju-gui/issues{/number}","pulls_url":"https://api.github.com/repos/kadams54/juju-gui/pulls{/number}","milestones_url":"https://api.github.com/repos/kadams54/juju-gui/milestones{/number}","notifications_url":"https://api.github.com/repos/kadams54/juju-gui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kadams54/juju-gui/labels{/name}","releases_url":"https://api.github.com/repos/kadams54/juju-gui/releases{/id}","deployments_url":"https://api.github.com/repos/kadams54/juju-gui/deployments","created_at":"2014-03-05T03:12:51Z","updated_at":"2016-01-11T14:41:14Z","pushed_at":"2016-08-25T19:28:42Z","git_url":"git://github.com/kadams54/juju-gui.git","ssh_url":"git@github.com:kadams54/juju-gui.git","clone_url":"https://github.com/kadams54/juju-gui.git","svn_url":"https://github.com/kadams54/juju-gui","homepage":null,"size":117674,"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":"juju:develop","ref":"develop","sha":"d2df68046ce6de9c57f28b424f740662629b41cf","user":{"login":"juju","id":4604548,"avatar_url":"https://avatars.githubusercontent.com/u/4604548?v=3","gravatar_id":"","url":"https://api.github.com/users/juju","html_url":"https://github.com/juju","followers_url":"https://api.github.com/users/juju/followers","following_url":"https://api.github.com/users/juju/following{/other_user}","gists_url":"https://api.github.com/users/juju/gists{/gist_id}","starred_url":"https://api.github.com/users/juju/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juju/subscriptions","organizations_url":"https://api.github.com/users/juju/orgs","repos_url":"https://api.github.com/users/juju/repos","events_url":"https://api.github.com/users/juju/events{/privacy}","received_events_url":"https://api.github.com/users/juju/received_events","type":"Organization","site_admin":false},"repo":{"id":14960387,"name":"juju-gui","full_name":"juju/juju-gui","owner":{"login":"juju","id":4604548,"avatar_url":"https://avatars.githubusercontent.com/u/4604548?v=3","gravatar_id":"","url":"https://api.github.com/users/juju","html_url":"https://github.com/juju","followers_url":"https://api.github.com/users/juju/followers","following_url":"https://api.github.com/users/juju/following{/other_user}","gists_url":"https://api.github.com/users/juju/gists{/gist_id}","starred_url":"https://api.github.com/users/juju/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juju/subscriptions","organizations_url":"https://api.github.com/users/juju/orgs","repos_url":"https://api.github.com/users/juju/repos","events_url":"https://api.github.com/users/juju/events{/privacy}","received_events_url":"https://api.github.com/users/juju/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/juju/juju-gui","description":"Juju-GUI is a web-based GUI for Juju <https://jujucharms.com/>.","fork":false,"url":"https://api.github.com/repos/juju/juju-gui","forks_url":"https://api.github.com/repos/juju/juju-gui/forks","keys_url":"https://api.github.com/repos/juju/juju-gui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/juju/juju-gui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/juju/juju-gui/teams","hooks_url":"https://api.github.com/repos/juju/juju-gui/hooks","issue_events_url":"https://api.github.com/repos/juju/juju-gui/issues/events{/number}","events_url":"https://api.github.com/repos/juju/juju-gui/events","assignees_url":"https://api.github.com/repos/juju/juju-gui/assignees{/user}","branches_url":"https://api.github.com/repos/juju/juju-gui/branches{/branch}","tags_url":"https://api.github.com/repos/juju/juju-gui/tags","blobs_url":"https://api.github.com/repos/juju/juju-gui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/juju/juju-gui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/juju/juju-gui/git/refs{/sha}","trees_url":"https://api.github.com/repos/juju/juju-gui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/juju/juju-gui/statuses/{sha}","languages_url":"https://api.github.com/repos/juju/juju-gui/languages","stargazers_url":"https://api.github.com/repos/juju/juju-gui/stargazers","contributors_url":"https://api.github.com/repos/juju/juju-gui/contributors","subscribers_url":"https://api.github.com/repos/juju/juju-gui/subscribers","subscription_url":"https://api.github.com/repos/juju/juju-gui/subscription","commits_url":"https://api.github.com/repos/juju/juju-gui/commits{/sha}","git_commits_url":"https://api.github.com/repos/juju/juju-gui/git/commits{/sha}","comments_url":"https://api.github.com/repos/juju/juju-gui/comments{/number}","issue_comment_url":"https://api.github.com/repos/juju/juju-gui/issues/comments{/number}","contents_url":"https://api.github.com/repos/juju/juju-gui/contents/{+path}","compare_url":"https://api.github.com/repos/juju/juju-gui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/juju/juju-gui/merges","archive_url":"https://api.github.com/repos/juju/juju-gui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/juju/juju-gui/downloads","issues_url":"https://api.github.com/repos/juju/juju-gui/issues{/number}","pulls_url":"https://api.github.com/repos/juju/juju-gui/pulls{/number}","milestones_url":"https://api.github.com/repos/juju/juju-gui/milestones{/number}","notifications_url":"https://api.github.com/repos/juju/juju-gui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/juju/juju-gui/labels{/name}","releases_url":"https://api.github.com/repos/juju/juju-gui/releases{/id}","deployments_url":"https://api.github.com/repos/juju/juju-gui/deployments","created_at":"2013-12-05T17:15:48Z","updated_at":"2016-08-18T08:20:17Z","pushed_at":"2016-08-28T22:27:43Z","git_url":"git://github.com/juju/juju-gui.git","ssh_url":"git@github.com:juju/juju-gui.git","clone_url":"https://github.com/juju/juju-gui.git","svn_url":"https://github.com/juju/juju-gui","homepage":"","size":122279,"stargazers_count":96,"watchers_count":96,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":58,"mirror_url":null,"open_issues_count":101,"forks":58,"open_issues":101,"watchers":96,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/juju/juju-gui/pulls/1949"},"html":{"href":"https://github.com/juju/juju-gui/pull/1949"},"issue":{"href":"https://api.github.com/repos/juju/juju-gui/issues/1949"},"comments":{"href":"https://api.github.com/repos/juju/juju-gui/issues/1949/comments"},"review_comments":{"href":"https://api.github.com/repos/juju/juju-gui/pulls/1949/comments"},"review_comment":{"href":"https://api.github.com/repos/juju/juju-gui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/juju/juju-gui/pulls/1949/commits"},"statuses":{"href":"https://api.github.com/repos/juju/juju-gui/statuses/420a5edfe480487ddf6f1b78ab0e68a573cefadb"}}}}
{"actor":{"display_login":"kadams54"}}