{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/109709227","pull_request_review_id":30829030,"id":109709227,"diff_hunk":"@@ -32,3 +36,64 @@ describe( 'index', () => {\n \t\t}\n \t} );\n } );\n+\n+describe( 'Signup flows configuration validation', () => {\n+\tlet FlowController, ProgressStore, DependencyStore, Flows, flowControllerInstance;\n+\n+\tuseFakeDom();\n+\n+\tuseMockery( ( mockery ) => {\n+\t\tmockery.registerMock( 'lib/abtest', {\n+\t\t\tabtest: identity,\n+\t\t\tgetABTestVariation: identity,\n+\t\t} );\n+\t\tmockery.registerMock( 'lib/signup/step-actions', {} );\n+\t} );\n+\n+\tbefore( () => {\n+\t\tProgressStore = require( 'lib/signup/progress-store' );\n+\t\tDependencyStore = require( 'lib/signup/dependency-store' );\n+\t\tFlowController = require( 'lib/signup/flow-controller' );\n+\t\tFlows = require( 'signup/config/flows' );\n+\t\tProgressStore.reset();\n+\t\tconst store = createStore( reducer );\n+\t\tDependencyStore.setReduxStore( store );\n+\n+\n+\t\t// temporarily instantiate the FlowController with a valid flow\n+\t\tflowControllerInstance = FlowController( {\n+\t\t\tflowName: 'account'\n+\t\t} );\n+\t} );\n+\n+\tdescribe( 'Signup flows configuration validation', () => {\n+\t\tObject.keys( flowsData ).forEach( ( flowName ) => {\n+\t\t\tdescribe( `Verifying flow \"${ flowName }\"`, () => {\n+\t\t\t\tafterEach( function() {\n+\t\t\t\t\tflowControllerInstance.reset();\n+\t\t\t\t\tDependencyStore.reset();\n+\t\t\t\t\tProgressStore.reset();\n+\t\t\t\t} );\n+\n+\t\t\t\tit( 'Valid configuration', () => {\n+\t\t\t\t\ttry {\n+\t\t\t\t\t\tflowControllerInstance = FlowController( {\n+\t\t\t\t\t\t\tflowName: flowName,\n+\t\t\t\t\t\t\tonComplete: () => {\n+\t\t\t\t\t\t\t\tconsole.log( 'Complete flow' );","path":"client/signup/config/test/index.js","position":70,"original_position":70,"commit_id":"45c3bb8f220cb7bc6d3dbb87e05869567b268bfc","original_commit_id":"45c3bb8f220cb7bc6d3dbb87e05869567b268bfc","user":{"login":"mcsf","id":150562,"avatar_url":"https://avatars3.githubusercontent.com/u/150562?v=3","gravatar_id":"","url":"https://api.github.com/users/mcsf","html_url":"https://github.com/mcsf","followers_url":"https://api.github.com/users/mcsf/followers","following_url":"https://api.github.com/users/mcsf/following{/other_user}","gists_url":"https://api.github.com/users/mcsf/gists{/gist_id}","starred_url":"https://api.github.com/users/mcsf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcsf/subscriptions","organizations_url":"https://api.github.com/users/mcsf/orgs","repos_url":"https://api.github.com/users/mcsf/repos","events_url":"https://api.github.com/users/mcsf/events{/privacy}","received_events_url":"https://api.github.com/users/mcsf/received_events","type":"User","site_admin":false},"body":"I was a little thrown off by this line. Removing the `log` statement didn't change the test outcome for me (I think).\r\n\r\nWhat I then did try, due to seeing the name `onComplete`, was the following:\r\n\r\n```diff\r\ndiff --git a/client/signup/config/test/index.js b/client/signup/config/test/index.js\r\nindex ee4bb5ec2..0caa98d37 100644\r\n--- a/client/signup/config/test/index.js\r\n+++ b/client/signup/config/test/index.js\r\n@@ -75,12 +75,12 @@ describe( 'Signup flows configuration validation', () => {\r\n \t\t\t\t\tProgressStore.reset();\r\n \t\t\t\t} );\r\n \r\n-\t\t\t\tit( 'Valid configuration', () => {\r\n+\t\t\t\tit( 'Valid configuration', ( done ) => {\r\n \t\t\t\t\ttry {\r\n \t\t\t\t\t\tflowControllerInstance = FlowController( {\r\n \t\t\t\t\t\t\tflowName: flowName,\r\n \t\t\t\t\t\t\tonComplete: () => {\r\n-\t\t\t\t\t\t\t\tconsole.log( 'Complete flow' );\r\n+\t\t\t\t\t\t\t\tdone();\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t} );\r\n \t\t\t\t\t} catch ( Exception ) {\r\n```\r\n\r\nbut this results in all tests timing out. As I'm mostly unfamiliar with Signup, my questions are:\r\n\r\n- Do we not expect the controller instance to _complete_?\r\n- If we don't, do we need to define a `onComplete` function? If so, can it be `noop`?\r\n- If we don't really reach `onComplete`, then we're really mostly testing by making sure no errors are thrown in that same stack. Layman's question: is that enough?","created_at":"2017-04-04T16:17:38Z","updated_at":"2017-04-04T16:20:25Z","html_url":"https://github.com/Automattic/wp-calypso/pull/11376#discussion_r109709227","pull_request_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/11376","_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/109709227"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/11376#discussion_r109709227"},"pull_request":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/11376"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/11376","id":105950012,"html_url":"https://github.com/Automattic/wp-calypso/pull/11376","diff_url":"https://github.com/Automattic/wp-calypso/pull/11376.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/11376.patch","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/11376","number":11376,"state":"open","locked":false,"title":"Signup: Check all Signup flows for a valid configuration","user":{"login":"bisko","id":184938,"avatar_url":"https://avatars0.githubusercontent.com/u/184938?v=3","gravatar_id":"","url":"https://api.github.com/users/bisko","html_url":"https://github.com/bisko","followers_url":"https://api.github.com/users/bisko/followers","following_url":"https://api.github.com/users/bisko/following{/other_user}","gists_url":"https://api.github.com/users/bisko/gists{/gist_id}","starred_url":"https://api.github.com/users/bisko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bisko/subscriptions","organizations_url":"https://api.github.com/users/bisko/orgs","repos_url":"https://api.github.com/users/bisko/repos","events_url":"https://api.github.com/users/bisko/events{/privacy}","received_events_url":"https://api.github.com/users/bisko/received_events","type":"User","site_admin":false},"body":"This PR introduces basic unit testing for the Signup flows. \r\n\r\nThis will help reveal errors in the Signup flows configuration that may appear from time to time and can be a bit obscure if a specific flow isn't covered by the E2E tests.\r\n\r\nThe PR doesn't cover all possible flow configuration tests and only verifies that the step dependencies, specified in the config, are met. \r\n\r\nThere are other tests that can be implemented, to properly test each flow from start to finish, to verify they are working correctly, but it requires improving the Signup framework to allow for proper unit-testing and is out of scope for the moment. \r\n\r\nSince the PR introduces some reorganization in the configuration files it would require testing.\r\n\r\nTo test:\r\n\r\n1. Checkout branch or use Calypso.live link\r\n2. Go through several flows in Signup, e.g. `main`, `premium`, the Jetpack flows, `get.blog` flows\r\n3. Verify Signup is working correctly\r\n4. Verify no errors in JS console","created_at":"2017-02-13T18:20:00Z","updated_at":"2017-04-04T16:20:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4ed18356c27a1a01f26f76b9cc4dcde0ca07a58c","assignee":{"login":"bisko","id":184938,"avatar_url":"https://avatars0.githubusercontent.com/u/184938?v=3","gravatar_id":"","url":"https://api.github.com/users/bisko","html_url":"https://github.com/bisko","followers_url":"https://api.github.com/users/bisko/followers","following_url":"https://api.github.com/users/bisko/following{/other_user}","gists_url":"https://api.github.com/users/bisko/gists{/gist_id}","starred_url":"https://api.github.com/users/bisko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bisko/subscriptions","organizations_url":"https://api.github.com/users/bisko/orgs","repos_url":"https://api.github.com/users/bisko/repos","events_url":"https://api.github.com/users/bisko/events{/privacy}","received_events_url":"https://api.github.com/users/bisko/received_events","type":"User","site_admin":false},"assignees":[{"login":"bisko","id":184938,"avatar_url":"https://avatars0.githubusercontent.com/u/184938?v=3","gravatar_id":"","url":"https://api.github.com/users/bisko","html_url":"https://github.com/bisko","followers_url":"https://api.github.com/users/bisko/followers","following_url":"https://api.github.com/users/bisko/following{/other_user}","gists_url":"https://api.github.com/users/bisko/gists{/gist_id}","starred_url":"https://api.github.com/users/bisko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bisko/subscriptions","organizations_url":"https://api.github.com/users/bisko/orgs","repos_url":"https://api.github.com/users/bisko/repos","events_url":"https://api.github.com/users/bisko/events{/privacy}","received_events_url":"https://api.github.com/users/bisko/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/11376/commits","review_comments_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/11376/comments","review_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/11376/comments","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/45c3bb8f220cb7bc6d3dbb87e05869567b268bfc","head":{"label":"Automattic:fix/signup-improve-signup-configuration-unit-tests","ref":"fix/signup-improve-signup-configuration-unit-tests","sha":"45c3bb8f220cb7bc6d3dbb87e05869567b268bfc","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars2.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"name":"wp-calypso","full_name":"Automattic/wp-calypso","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars2.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/wp-calypso","description":"The new JavaScript- and API-powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/wp-calypso/deployments","created_at":"2015-11-10T20:00:16Z","updated_at":"2017-04-04T16:08:48Z","pushed_at":"2017-04-04T16:19:40Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":59219,"stargazers_count":8612,"watchers_count":8612,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1103,"mirror_url":null,"open_issues_count":1816,"forks":1103,"open_issues":1816,"watchers":8612,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"1ef98268f8379b2a9d9d0afd3451d704bf1c86f7","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars2.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"name":"wp-calypso","full_name":"Automattic/wp-calypso","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars2.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/wp-calypso","description":"The new JavaScript- and API-powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/wp-calypso/deployments","created_at":"2015-11-10T20:00:16Z","updated_at":"2017-04-04T16:08:48Z","pushed_at":"2017-04-04T16:19:40Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":59219,"stargazers_count":8612,"watchers_count":8612,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1103,"mirror_url":null,"open_issues_count":1816,"forks":1103,"open_issues":1816,"watchers":8612,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/11376"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/11376"},"issue":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/11376"},"comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/11376/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/11376/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/11376/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/wp-calypso/statuses/45c3bb8f220cb7bc6d3dbb87e05869567b268bfc"}}}}
{"actor":{"display_login":"mcsf"}}