{"action":"created","comment":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/comments/192456536","pull_request_review_id":125243984,"id":192456536,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MjQ1NjUzNg==","diff_hunk":"@@ -0,0 +1,159 @@\n+/**\n+ * Copyright 2018 The AMP HTML Authors. All Rights Reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *      http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS-IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+import {isExperimentOn, toggleExperiment} from '../../../../../src/experiments';\n+\n+const config = describe.configure().ifNewChrome();\n+config.run('amp-fx-collection', function() {\n+  this.timeout(100000);\n+\n+  const css = `\n+    .spacer {\n+      height: 100vh;\n+      width: 100%;\n+      background-color: red;\n+    }\n+\n+    #animTarget {\n+      height: 100px;\n+      width: 100%;\n+      top: 20vh;\n+      background-color: green;\n+    }\n+  `;\n+\n+  const extensions = ['amp-fx-collection'];\n+\n+\n+  // Can't test a default `fly-in-left` animation as the\n+  // `data-fly-in-distance` and `data-duration` parameters differ/device.\n+  const bodyLeft = `\n+    <div class=\"spacer\"></div>\n+    <div id=\"animTarget\"\n+      amp-fx=\"fly-in-left\"\n+      data-duration=\"500ms\"\n+      data-fly-in-distance=\"25%\"\n+      data-margin-start=\"20%\">\n+    </div>\n+    <div class=\"spacer\"></div>\n+  `;\n+\n+  describes.integration(\"amp-fx='fly-in-left'\", {\n+    body: bodyLeft,\n+    css,\n+    extensions,\n+  }, env => {\n+\n+    let win;\n+    beforeEach(() => {\n+      win = env.win;\n+      toggleExperiment(win, 'amp-fx-fly-in', true, false);\n+    });\n+\n+    it('runs fly-in-left animation with default parameters', () => {\n+      expect(isExperimentOn(win, 'amp-fx-fly-in')).to.be.true;\n+      const initialLeft = getComputedLeft(win);\n+      win.scrollTo(0, 0.5 * getViewportHeight(win));\n+      return win.setTimeout(() => {\n+        expect(getComputedLeft(win)).to.be.above(initialLeft);\n+      }, 2000);\n+    });\n+  });\n+\n+  // Can't test a default `fly-in-right` animation as the\n+  // `data-fly-in-distance` and `data-duration` parameters differ/device.\n+  const bodyRight = `\n+    <div class=\"spacer\"></div>\n+    <div id=\"animTarget\"\n+      amp-fx=\"fly-in-right\"\n+      data-duration=\"500ms\"\n+      data-fly-in-distance=\"25%\"\n+      data-margin-start=\"20%\">\n+    </div>\n+    <div class=\"spacer\"></div>\n+  `;\n+\n+  describes.integration(\"amp-fx='fly-in-right'\", {\n+    body: bodyRight,\n+    css,\n+    extensions,\n+  }, env => {\n+\n+    let win;\n+    beforeEach(() => {\n+      win = env.win;\n+      toggleExperiment(win, 'amp-fx-fly-in', true, false);\n+    });\n+\n+    it('runs fly-in-right animation with default parameters', () => {\n+      expect(isExperimentOn(win, 'amp-fx-fly-in')).to.be.true;\n+      const initialLeft = getComputedLeft(win);\n+      win.scrollTo(0, 0.5 * getViewportHeight(win));\n+      return win.setTimeout(() => {\n+        expect(getComputedLeft(win)).to.be.below(initialLeft);\n+      }, 2000);\n+    });\n+  });\n+\n+  // Can't test a default `fly-in-bottom` animation as the\n+  // `data-fly-in-distance` and `data-duration` parameters differ/device.\n+  const bodyBottom = `\n+    <div class=\"spacer\"></div>\n+    <div id=\"animTarget\"\n+      amp-fx=\"fly-in-bottom\"\n+      data-duration=\"500ms\"\n+      data-fly-in-distance=\"25%\"\n+      data-margin-start=\"20%\">\n+    </div>\n+    <div class=\"spacer\"></div>\n+  `;\n+\n+  describes.integration(\"amp-fx='fly-in-bottom'\", {\n+    body: bodyBottom,\n+    css,\n+    extensions,\n+  }, env => {\n+\n+    let win;\n+    beforeEach(() => {\n+      win = env.win;\n+      toggleExperiment(win, 'amp-fx-fly-in', true, false);\n+    });\n+\n+    it('runs fly-in-bottom animation with default parameters', () => {\n+      expect(isExperimentOn(win, 'amp-fx-fly-in')).to.be.true;\n+      const initialTop = getComputedTop(win);\n+      win.scrollTo(0, 0.5 * getViewportHeight(win));\n+      return win.setTimeout(() => {","path":"extensions/amp-fx-collection/0.1/test/integration/test-amp-fx-fly-in.js","position":140,"original_position":140,"commit_id":"f277df6c1f04099fb19e3599808eb7802b7036b1","original_commit_id":"f277df6c1f04099fb19e3599808eb7802b7036b1","user":{"login":"cvializ","id":2363700,"node_id":"MDQ6VXNlcjIzNjM3MDA=","avatar_url":"https://avatars2.githubusercontent.com/u/2363700?v=4","gravatar_id":"","url":"https://api.github.com/users/cvializ","html_url":"https://github.com/cvializ","followers_url":"https://api.github.com/users/cvializ/followers","following_url":"https://api.github.com/users/cvializ/following{/other_user}","gists_url":"https://api.github.com/users/cvializ/gists{/gist_id}","starred_url":"https://api.github.com/users/cvializ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cvializ/subscriptions","organizations_url":"https://api.github.com/users/cvializ/orgs","repos_url":"https://api.github.com/users/cvializ/repos","events_url":"https://api.github.com/users/cvializ/events{/privacy}","received_events_url":"https://api.github.com/users/cvializ/received_events","type":"User","site_admin":false},"body":"Ah you still need to return a Promise so the test knows when it's done. You could keep your original `timeout` utility function, but at the call site you'd call \r\n```js\r\nreturn timeout(2000).then(() => { /* ... */ });\r\n```\r\ninstead of \r\n```js\r\nreturn Promise.resolve().then(timeout(2000)).then(() => { /* ... */ });\r\n```","created_at":"2018-06-01T17:00:01Z","updated_at":"2018-06-01T17:00:01Z","html_url":"https://github.com/ampproject/amphtml/pull/15682#discussion_r192456536","pull_request_url":"https://api.github.com/repos/ampproject/amphtml/pulls/15682","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/comments/192456536"},"html":{"href":"https://github.com/ampproject/amphtml/pull/15682#discussion_r192456536"},"pull_request":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/15682"}}},"pull_request":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/15682","id":191604586,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkxNjA0NTg2","html_url":"https://github.com/ampproject/amphtml/pull/15682","diff_url":"https://github.com/ampproject/amphtml/pull/15682.diff","patch_url":"https://github.com/ampproject/amphtml/pull/15682.patch","issue_url":"https://api.github.com/repos/ampproject/amphtml/issues/15682","number":15682,"state":"open","locked":false,"title":"Add integration tests for <amp-fx=\"fly-in-{bottom,left,right}\">","user":{"login":"nainar","id":7919520,"node_id":"MDQ6VXNlcjc5MTk1MjA=","avatar_url":"https://avatars2.githubusercontent.com/u/7919520?v=4","gravatar_id":"","url":"https://api.github.com/users/nainar","html_url":"https://github.com/nainar","followers_url":"https://api.github.com/users/nainar/followers","following_url":"https://api.github.com/users/nainar/following{/other_user}","gists_url":"https://api.github.com/users/nainar/gists{/gist_id}","starred_url":"https://api.github.com/users/nainar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nainar/subscriptions","organizations_url":"https://api.github.com/users/nainar/orgs","repos_url":"https://api.github.com/users/nainar/repos","events_url":"https://api.github.com/users/nainar/events{/privacy}","received_events_url":"https://api.github.com/users/nainar/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-05-30T23:08:48Z","updated_at":"2018-06-01T17:00:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"29500582a3a8f3469d3fdff67c59c58900d15072","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":596633554,"node_id":"MDU6TGFiZWw1OTY2MzM1NTQ=","url":"https://api.github.com/repos/ampproject/amphtml/labels/cla:%20yes","name":"cla: yes","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ampproject/amphtml/pulls/15682/commits","review_comments_url":"https://api.github.com/repos/ampproject/amphtml/pulls/15682/comments","review_comment_url":"https://api.github.com/repos/ampproject/amphtml/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ampproject/amphtml/issues/15682/comments","statuses_url":"https://api.github.com/repos/ampproject/amphtml/statuses/f277df6c1f04099fb19e3599808eb7802b7036b1","head":{"label":"nainar:fly_in_tests","ref":"fly_in_tests","sha":"f277df6c1f04099fb19e3599808eb7802b7036b1","user":{"login":"nainar","id":7919520,"node_id":"MDQ6VXNlcjc5MTk1MjA=","avatar_url":"https://avatars2.githubusercontent.com/u/7919520?v=4","gravatar_id":"","url":"https://api.github.com/users/nainar","html_url":"https://github.com/nainar","followers_url":"https://api.github.com/users/nainar/followers","following_url":"https://api.github.com/users/nainar/following{/other_user}","gists_url":"https://api.github.com/users/nainar/gists{/gist_id}","starred_url":"https://api.github.com/users/nainar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nainar/subscriptions","organizations_url":"https://api.github.com/users/nainar/orgs","repos_url":"https://api.github.com/users/nainar/repos","events_url":"https://api.github.com/users/nainar/events{/privacy}","received_events_url":"https://api.github.com/users/nainar/received_events","type":"User","site_admin":false},"repo":{"id":117491033,"node_id":"MDEwOlJlcG9zaXRvcnkxMTc0OTEwMzM=","name":"amphtml","full_name":"nainar/amphtml","owner":{"login":"nainar","id":7919520,"node_id":"MDQ6VXNlcjc5MTk1MjA=","avatar_url":"https://avatars2.githubusercontent.com/u/7919520?v=4","gravatar_id":"","url":"https://api.github.com/users/nainar","html_url":"https://github.com/nainar","followers_url":"https://api.github.com/users/nainar/followers","following_url":"https://api.github.com/users/nainar/following{/other_user}","gists_url":"https://api.github.com/users/nainar/gists{/gist_id}","starred_url":"https://api.github.com/users/nainar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nainar/subscriptions","organizations_url":"https://api.github.com/users/nainar/orgs","repos_url":"https://api.github.com/users/nainar/repos","events_url":"https://api.github.com/users/nainar/events{/privacy}","received_events_url":"https://api.github.com/users/nainar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nainar/amphtml","description":"AMP HTML source code, samples, and documentation.  See below for more info.","fork":true,"url":"https://api.github.com/repos/nainar/amphtml","forks_url":"https://api.github.com/repos/nainar/amphtml/forks","keys_url":"https://api.github.com/repos/nainar/amphtml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nainar/amphtml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nainar/amphtml/teams","hooks_url":"https://api.github.com/repos/nainar/amphtml/hooks","issue_events_url":"https://api.github.com/repos/nainar/amphtml/issues/events{/number}","events_url":"https://api.github.com/repos/nainar/amphtml/events","assignees_url":"https://api.github.com/repos/nainar/amphtml/assignees{/user}","branches_url":"https://api.github.com/repos/nainar/amphtml/branches{/branch}","tags_url":"https://api.github.com/repos/nainar/amphtml/tags","blobs_url":"https://api.github.com/repos/nainar/amphtml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nainar/amphtml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nainar/amphtml/git/refs{/sha}","trees_url":"https://api.github.com/repos/nainar/amphtml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nainar/amphtml/statuses/{sha}","languages_url":"https://api.github.com/repos/nainar/amphtml/languages","stargazers_url":"https://api.github.com/repos/nainar/amphtml/stargazers","contributors_url":"https://api.github.com/repos/nainar/amphtml/contributors","subscribers_url":"https://api.github.com/repos/nainar/amphtml/subscribers","subscription_url":"https://api.github.com/repos/nainar/amphtml/subscription","commits_url":"https://api.github.com/repos/nainar/amphtml/commits{/sha}","git_commits_url":"https://api.github.com/repos/nainar/amphtml/git/commits{/sha}","comments_url":"https://api.github.com/repos/nainar/amphtml/comments{/number}","issue_comment_url":"https://api.github.com/repos/nainar/amphtml/issues/comments{/number}","contents_url":"https://api.github.com/repos/nainar/amphtml/contents/{+path}","compare_url":"https://api.github.com/repos/nainar/amphtml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nainar/amphtml/merges","archive_url":"https://api.github.com/repos/nainar/amphtml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nainar/amphtml/downloads","issues_url":"https://api.github.com/repos/nainar/amphtml/issues{/number}","pulls_url":"https://api.github.com/repos/nainar/amphtml/pulls{/number}","milestones_url":"https://api.github.com/repos/nainar/amphtml/milestones{/number}","notifications_url":"https://api.github.com/repos/nainar/amphtml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nainar/amphtml/labels{/name}","releases_url":"https://api.github.com/repos/nainar/amphtml/releases{/id}","deployments_url":"https://api.github.com/repos/nainar/amphtml/deployments","created_at":"2018-01-15T03:09:24Z","updated_at":"2018-01-15T03:09:36Z","pushed_at":"2018-06-01T16:46:06Z","git_url":"git://github.com/nainar/amphtml.git","ssh_url":"git@github.com:nainar/amphtml.git","clone_url":"https://github.com/nainar/amphtml.git","svn_url":"https://github.com/nainar/amphtml","homepage":"https://www.ampproject.org","size":456862,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ampproject:master","ref":"master","sha":"4ab70c99249162651df30b4ca3c331ba9f15994b","user":{"login":"ampproject","id":14114390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTE0Mzkw","avatar_url":"https://avatars3.githubusercontent.com/u/14114390?v=4","gravatar_id":"","url":"https://api.github.com/users/ampproject","html_url":"https://github.com/ampproject","followers_url":"https://api.github.com/users/ampproject/followers","following_url":"https://api.github.com/users/ampproject/following{/other_user}","gists_url":"https://api.github.com/users/ampproject/gists{/gist_id}","starred_url":"https://api.github.com/users/ampproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampproject/subscriptions","organizations_url":"https://api.github.com/users/ampproject/orgs","repos_url":"https://api.github.com/users/ampproject/repos","events_url":"https://api.github.com/users/ampproject/events{/privacy}","received_events_url":"https://api.github.com/users/ampproject/received_events","type":"Organization","site_admin":false},"repo":{"id":41766002,"node_id":"MDEwOlJlcG9zaXRvcnk0MTc2NjAwMg==","name":"amphtml","full_name":"ampproject/amphtml","owner":{"login":"ampproject","id":14114390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTE0Mzkw","avatar_url":"https://avatars3.githubusercontent.com/u/14114390?v=4","gravatar_id":"","url":"https://api.github.com/users/ampproject","html_url":"https://github.com/ampproject","followers_url":"https://api.github.com/users/ampproject/followers","following_url":"https://api.github.com/users/ampproject/following{/other_user}","gists_url":"https://api.github.com/users/ampproject/gists{/gist_id}","starred_url":"https://api.github.com/users/ampproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampproject/subscriptions","organizations_url":"https://api.github.com/users/ampproject/orgs","repos_url":"https://api.github.com/users/ampproject/repos","events_url":"https://api.github.com/users/ampproject/events{/privacy}","received_events_url":"https://api.github.com/users/ampproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ampproject/amphtml","description":"AMP HTML source code, samples, and documentation.  See below for more info.","fork":false,"url":"https://api.github.com/repos/ampproject/amphtml","forks_url":"https://api.github.com/repos/ampproject/amphtml/forks","keys_url":"https://api.github.com/repos/ampproject/amphtml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ampproject/amphtml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ampproject/amphtml/teams","hooks_url":"https://api.github.com/repos/ampproject/amphtml/hooks","issue_events_url":"https://api.github.com/repos/ampproject/amphtml/issues/events{/number}","events_url":"https://api.github.com/repos/ampproject/amphtml/events","assignees_url":"https://api.github.com/repos/ampproject/amphtml/assignees{/user}","branches_url":"https://api.github.com/repos/ampproject/amphtml/branches{/branch}","tags_url":"https://api.github.com/repos/ampproject/amphtml/tags","blobs_url":"https://api.github.com/repos/ampproject/amphtml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ampproject/amphtml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ampproject/amphtml/git/refs{/sha}","trees_url":"https://api.github.com/repos/ampproject/amphtml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ampproject/amphtml/statuses/{sha}","languages_url":"https://api.github.com/repos/ampproject/amphtml/languages","stargazers_url":"https://api.github.com/repos/ampproject/amphtml/stargazers","contributors_url":"https://api.github.com/repos/ampproject/amphtml/contributors","subscribers_url":"https://api.github.com/repos/ampproject/amphtml/subscribers","subscription_url":"https://api.github.com/repos/ampproject/amphtml/subscription","commits_url":"https://api.github.com/repos/ampproject/amphtml/commits{/sha}","git_commits_url":"https://api.github.com/repos/ampproject/amphtml/git/commits{/sha}","comments_url":"https://api.github.com/repos/ampproject/amphtml/comments{/number}","issue_comment_url":"https://api.github.com/repos/ampproject/amphtml/issues/comments{/number}","contents_url":"https://api.github.com/repos/ampproject/amphtml/contents/{+path}","compare_url":"https://api.github.com/repos/ampproject/amphtml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ampproject/amphtml/merges","archive_url":"https://api.github.com/repos/ampproject/amphtml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ampproject/amphtml/downloads","issues_url":"https://api.github.com/repos/ampproject/amphtml/issues{/number}","pulls_url":"https://api.github.com/repos/ampproject/amphtml/pulls{/number}","milestones_url":"https://api.github.com/repos/ampproject/amphtml/milestones{/number}","notifications_url":"https://api.github.com/repos/ampproject/amphtml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ampproject/amphtml/labels{/name}","releases_url":"https://api.github.com/repos/ampproject/amphtml/releases{/id}","deployments_url":"https://api.github.com/repos/ampproject/amphtml/deployments","created_at":"2015-09-01T22:10:53Z","updated_at":"2018-06-01T16:58:09Z","pushed_at":"2018-06-01T16:58:37Z","git_url":"git://github.com/ampproject/amphtml.git","ssh_url":"git@github.com:ampproject/amphtml.git","clone_url":"https://github.com/ampproject/amphtml.git","svn_url":"https://github.com/ampproject/amphtml","homepage":"https://www.ampproject.org","size":446553,"stargazers_count":11648,"watchers_count":11648,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":2415,"mirror_url":null,"archived":false,"open_issues_count":1260,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":2415,"open_issues":1260,"watchers":11648,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/15682"},"html":{"href":"https://github.com/ampproject/amphtml/pull/15682"},"issue":{"href":"https://api.github.com/repos/ampproject/amphtml/issues/15682"},"comments":{"href":"https://api.github.com/repos/ampproject/amphtml/issues/15682/comments"},"review_comments":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/15682/comments"},"review_comment":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/15682/commits"},"statuses":{"href":"https://api.github.com/repos/ampproject/amphtml/statuses/f277df6c1f04099fb19e3599808eb7802b7036b1"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"cvializ"}}