From 864f9540157f0be6c4b576cf3f61d13580893bc3 Mon Sep 17 00:00:00 2001 From: Steven Dufresne Date: Mon, 11 May 2020 12:25:50 +0900 Subject: [PATCH] Block Directory: Add end 2 end tests. (#20023) * Add empty block-directory e2e test file. * Rough in a test that is throwing async issues. * Add test for empty results and adding block. * Change button from isDefault -> isSecondary which is breaking test. * Fix a typo in a comment. * Lint the test files based on the new linter. * Change the url because its no longer being encoded. * Appropriately name the response functions. * Try clearing the mock responses after each test for Travis CI. * Add some logging to test travis CI. * Change the urls to be an array to see if it will pass Travis CI. * Support both urls to test travis CI. * Add some more logging. * More logging to debug travis * Make sure the experiment is turned on. * Depending on the environment the urls can be different. * Update tests to reflect changes in core. * Add console.logs to debug integration server test errors. * Remove the console logs from the e2e tests. * Move the test & snapshot to the experiments folder. * Update mock variables to be uppercase. * Move mock responses above the tests. * Update packages/e2e-tests/specs/experiments/block-directory-add.test.js Add a delay before checking the post content for reliability. Co-authored-by: Kelly Dwan * Remove unused function. * Switch json responses to used export function. Co-authored-by: Kelly Dwan --- .../downloadable-block-header/index.js | 2 +- .../block-directory-add.test.js.snap | 3 + .../experiments/block-directory-add.test.js | 166 ++++++++++++++++++ 3 files changed, 170 insertions(+), 1 deletion(-) create mode 100644 packages/e2e-tests/specs/experiments/__snapshots__/block-directory-add.test.js.snap create mode 100644 packages/e2e-tests/specs/experiments/block-directory-add.test.js diff --git a/packages/block-directory/src/components/downloadable-block-header/index.js b/packages/block-directory/src/components/downloadable-block-header/index.js index dc835ed329539..0c37daef7bd65 100644 --- a/packages/block-directory/src/components/downloadable-block-header/index.js +++ b/packages/block-directory/src/components/downloadable-block-header/index.js @@ -44,7 +44,7 @@ function DownloadableBlockHeader( {