From 1d24b580700cf794420883e81f6b0dcc432b0269 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Mon, 18 Sep 2023 16:35:36 -0500 Subject: [PATCH 01/29] Refactoring test Bash script for parallelization. --- .buildkite/scripts/pipeline_test.sh | 44 +++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/.buildkite/scripts/pipeline_test.sh b/.buildkite/scripts/pipeline_test.sh index 7fef13e2c04..0a2a40f8aa5 100644 --- a/.buildkite/scripts/pipeline_test.sh +++ b/.buildkite/scripts/pipeline_test.sh @@ -2,15 +2,35 @@ set -euo pipefail -docker run \ - -i --rm \ - --env GIT_COMMITTER_NAME=test \ - --env GIT_COMMITTER_EMAIL=test \ - --env HOME=/tmp \ - --user="$(id -u):$(id -g)" \ - --volume="$(pwd):/app" \ - --workdir=/app \ - docker.elastic.co/eui/ci:5.3 \ - bash -c "/opt/yarn*/bin/yarn \ - && yarn cypress install \ - && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-ci" +TEST_TYPE='unit' + +DOCKER_OPTIONS=( + -i --rm + --env GIT_COMMITTER_NAME=test + --env GIT_COMMITTER_EMAIL=test + --env HOME=/tmp + --user="$(id -u):$(id -g)" + --volume="$(pwd):/app" + --workdir=/app + docker.elastic.co/eui/ci:5.3 + bash -c "/opt/yarn*/bin/yarn" +) + +if [[ "${TEST_TYPE}" == 'lint' ]]; then + echo "[TASK]: Running linters" + DOCKER_OPTIONS+=("NODE_OPTIONS=\"--max-old-space-size=2048\" yarn lint") +elif [[ "${TEST_TYPE}" == 'unit' ]]; then + echo "[TASK]: Running unit tests" + DOCKER_OPTIONS+=("NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-unit") +elif [[ "${TEST_TYPE}" == 'cypress:16' ]]; then + echo "[TASK]: Running Cypress tests against React 16" + DOCKER_OPTIONS+=("yarn cypress install" "NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 16") +elif [[ "${TEST_TYPE}" == 'cypress:17' ]]; then + echo "[TASK]: Running Cypress tests against React 17" + DOCKER_OPTIONS+=("yarn cypress install" "NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 17") +elif [[ "${TEST_TYPE}" == 'cypress:18' ]]; then + echo "[TASK]: Running Cypress tests against React 18" + DOCKER_OPTIONS+=("yarn cypress install" "NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 18") +fi + +docker run "${DOCKER_OPTIONS[@]}" From f5442c7c507bf37d2bbb9099b39e0526f1eeebfd Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Mon, 18 Sep 2023 16:36:02 -0500 Subject: [PATCH 02/29] Splitting test tasks linting and unit testing. --- .buildkite/pipelines/pipeline_pull_request_test.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.buildkite/pipelines/pipeline_pull_request_test.yml b/.buildkite/pipelines/pipeline_pull_request_test.yml index af25c625a9f..31cf0187280 100644 --- a/.buildkite/pipelines/pipeline_pull_request_test.yml +++ b/.buildkite/pipelines/pipeline_pull_request_test.yml @@ -3,7 +3,11 @@ steps: - agents: provider: "gcp" - command: .buildkite/scripts/pipeline_test.sh + - command: .buildkite/scripts/pipeline_test.sh + env: + TEST_TYPE: 'lint' + if: build.branch != "main" # We're skipping testing commits in main for now to maintain parity with previous Jenkins setup + - command: .buildkite/scripts/pipeline_test.sh + env: + TEST_TYPE: 'unit' if: build.branch != "main" # We're skipping testing commits in main for now to maintain parity with previous Jenkins setup - artifact_paths: - - "cypress/screenshots/**/*.png" From 69fd82c6006c84a517a7e83b8b1cd40ff1cc87c9 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Mon, 18 Sep 2023 16:42:03 -0500 Subject: [PATCH 03/29] Moved agents declaration into individual steps. --- .buildkite/pipelines/pipeline_pull_request_test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.buildkite/pipelines/pipeline_pull_request_test.yml b/.buildkite/pipelines/pipeline_pull_request_test.yml index 31cf0187280..f48ddf661af 100644 --- a/.buildkite/pipelines/pipeline_pull_request_test.yml +++ b/.buildkite/pipelines/pipeline_pull_request_test.yml @@ -1,13 +1,15 @@ # 🏠/.buildkite/pipelines/pipeline_pull_request_test.yml steps: - - agents: - provider: "gcp" - command: .buildkite/scripts/pipeline_test.sh + agents: + provider: "gcp" env: TEST_TYPE: 'lint' if: build.branch != "main" # We're skipping testing commits in main for now to maintain parity with previous Jenkins setup - command: .buildkite/scripts/pipeline_test.sh + agents: + provider: "gcp" env: TEST_TYPE: 'unit' if: build.branch != "main" # We're skipping testing commits in main for now to maintain parity with previous Jenkins setup From 2fb57476f291a368bc5d4e58a9ca0085eeced4eb Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Mon, 18 Sep 2023 16:57:30 -0500 Subject: [PATCH 04/29] Was missing the double ampersand to run Yarn commands. --- .buildkite/scripts/pipeline_test.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.buildkite/scripts/pipeline_test.sh b/.buildkite/scripts/pipeline_test.sh index 0a2a40f8aa5..f666bf56724 100644 --- a/.buildkite/scripts/pipeline_test.sh +++ b/.buildkite/scripts/pipeline_test.sh @@ -18,19 +18,19 @@ DOCKER_OPTIONS=( if [[ "${TEST_TYPE}" == 'lint' ]]; then echo "[TASK]: Running linters" - DOCKER_OPTIONS+=("NODE_OPTIONS=\"--max-old-space-size=2048\" yarn lint") + DOCKER_OPTIONS+=("&& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn lint") elif [[ "${TEST_TYPE}" == 'unit' ]]; then echo "[TASK]: Running unit tests" - DOCKER_OPTIONS+=("NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-unit") + DOCKER_OPTIONS+=("&& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-unit") elif [[ "${TEST_TYPE}" == 'cypress:16' ]]; then echo "[TASK]: Running Cypress tests against React 16" - DOCKER_OPTIONS+=("yarn cypress install" "NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 16") + DOCKER_OPTIONS+=("&& yarn cypress install" "&& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 16") elif [[ "${TEST_TYPE}" == 'cypress:17' ]]; then echo "[TASK]: Running Cypress tests against React 17" - DOCKER_OPTIONS+=("yarn cypress install" "NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 17") + DOCKER_OPTIONS+=("&& yarn cypress install" "&& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 17") elif [[ "${TEST_TYPE}" == 'cypress:18' ]]; then echo "[TASK]: Running Cypress tests against React 18" - DOCKER_OPTIONS+=("yarn cypress install" "NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 18") + DOCKER_OPTIONS+=("&& yarn cypress install" "&& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 18") fi docker run "${DOCKER_OPTIONS[@]}" From 0902f9af131533f25708ca68400c966b4723e51f Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Mon, 18 Sep 2023 17:09:06 -0500 Subject: [PATCH 05/29] Restoring Cypress install to all commands. --- .buildkite/scripts/pipeline_test.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.buildkite/scripts/pipeline_test.sh b/.buildkite/scripts/pipeline_test.sh index f666bf56724..88294253704 100644 --- a/.buildkite/scripts/pipeline_test.sh +++ b/.buildkite/scripts/pipeline_test.sh @@ -2,7 +2,7 @@ set -euo pipefail -TEST_TYPE='unit' +# TEST_TYPE='unit' DOCKER_OPTIONS=( -i --rm @@ -18,10 +18,10 @@ DOCKER_OPTIONS=( if [[ "${TEST_TYPE}" == 'lint' ]]; then echo "[TASK]: Running linters" - DOCKER_OPTIONS+=("&& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn lint") + DOCKER_OPTIONS+=("&& yarn cypress install" "&& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn lint") elif [[ "${TEST_TYPE}" == 'unit' ]]; then echo "[TASK]: Running unit tests" - DOCKER_OPTIONS+=("&& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-unit") + DOCKER_OPTIONS+=("&& yarn cypress install" "&& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-unit") elif [[ "${TEST_TYPE}" == 'cypress:16' ]]; then echo "[TASK]: Running Cypress tests against React 16" DOCKER_OPTIONS+=("&& yarn cypress install" "&& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 16") From 7967c917eaffce2a980fa241cfe91277f78e7caa Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Tue, 19 Sep 2023 09:53:26 -0500 Subject: [PATCH 06/29] Adjusting conditional array adds to be one string each. --- .buildkite/scripts/pipeline_test.sh | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.buildkite/scripts/pipeline_test.sh b/.buildkite/scripts/pipeline_test.sh index 88294253704..ed41426fb77 100644 --- a/.buildkite/scripts/pipeline_test.sh +++ b/.buildkite/scripts/pipeline_test.sh @@ -2,8 +2,6 @@ set -euo pipefail -# TEST_TYPE='unit' - DOCKER_OPTIONS=( -i --rm --env GIT_COMMITTER_NAME=test @@ -13,24 +11,23 @@ DOCKER_OPTIONS=( --volume="$(pwd):/app" --workdir=/app docker.elastic.co/eui/ci:5.3 - bash -c "/opt/yarn*/bin/yarn" ) if [[ "${TEST_TYPE}" == 'lint' ]]; then echo "[TASK]: Running linters" - DOCKER_OPTIONS+=("&& yarn cypress install" "&& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn lint") + DOCKER_OPTIONS+=(bash -c \"/opt/yarn\*/bin/yarn \&\& yarn cypress install \&\& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn lint\") elif [[ "${TEST_TYPE}" == 'unit' ]]; then echo "[TASK]: Running unit tests" - DOCKER_OPTIONS+=("&& yarn cypress install" "&& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-unit") + DOCKER_OPTIONS+=(bash -c \"/opt/yarn\*/bin/yarn \&\& yarn cypress install \&\& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-unit\") elif [[ "${TEST_TYPE}" == 'cypress:16' ]]; then echo "[TASK]: Running Cypress tests against React 16" - DOCKER_OPTIONS+=("&& yarn cypress install" "&& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 16") + DOCKER_OPTIONS+=(bash -c \"/opt/yarn\*/bin/yarn \&\& yarn cypress install \&\& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 16\") elif [[ "${TEST_TYPE}" == 'cypress:17' ]]; then echo "[TASK]: Running Cypress tests against React 17" - DOCKER_OPTIONS+=("&& yarn cypress install" "&& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 17") + DOCKER_OPTIONS+=(bash -c \"/opt/yarn\*/bin/yarn \&\& yarn cypress install \&\& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 17\") elif [[ "${TEST_TYPE}" == 'cypress:18' ]]; then echo "[TASK]: Running Cypress tests against React 18" - DOCKER_OPTIONS+=("&& yarn cypress install" "&& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 18") + DOCKER_OPTIONS+=(bash -c \"/opt/yarn\*/bin/yarn \&\& yarn cypress install \&\& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 18\") fi docker run "${DOCKER_OPTIONS[@]}" From 3c4493c37c5f6249b495f4683e7a860e9a40e827 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Tue, 19 Sep 2023 10:08:28 -0500 Subject: [PATCH 07/29] Removed double quote literals for bash -c command. --- .buildkite/scripts/pipeline_test.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.buildkite/scripts/pipeline_test.sh b/.buildkite/scripts/pipeline_test.sh index ed41426fb77..a037d30e313 100644 --- a/.buildkite/scripts/pipeline_test.sh +++ b/.buildkite/scripts/pipeline_test.sh @@ -15,19 +15,19 @@ DOCKER_OPTIONS=( if [[ "${TEST_TYPE}" == 'lint' ]]; then echo "[TASK]: Running linters" - DOCKER_OPTIONS+=(bash -c \"/opt/yarn\*/bin/yarn \&\& yarn cypress install \&\& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn lint\") + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" yarn lint") elif [[ "${TEST_TYPE}" == 'unit' ]]; then echo "[TASK]: Running unit tests" - DOCKER_OPTIONS+=(bash -c \"/opt/yarn\*/bin/yarn \&\& yarn cypress install \&\& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-unit\") + DOCKER_OPTIONS+=(bash -c "/opt/yarn\*/bin/yarn \&\& yarn cypress install \&\& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-unit") elif [[ "${TEST_TYPE}" == 'cypress:16' ]]; then echo "[TASK]: Running Cypress tests against React 16" - DOCKER_OPTIONS+=(bash -c \"/opt/yarn\*/bin/yarn \&\& yarn cypress install \&\& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 16\") + DOCKER_OPTIONS+=(bash -c "/opt/yarn\*/bin/yarn \&\& yarn cypress install \&\& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 16") elif [[ "${TEST_TYPE}" == 'cypress:17' ]]; then echo "[TASK]: Running Cypress tests against React 17" - DOCKER_OPTIONS+=(bash -c \"/opt/yarn\*/bin/yarn \&\& yarn cypress install \&\& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 17\") + DOCKER_OPTIONS+=(bash -c "/opt/yarn\*/bin/yarn \&\& yarn cypress install \&\& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 17") elif [[ "${TEST_TYPE}" == 'cypress:18' ]]; then echo "[TASK]: Running Cypress tests against React 18" - DOCKER_OPTIONS+=(bash -c \"/opt/yarn\*/bin/yarn \&\& yarn cypress install \&\& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 18\") + DOCKER_OPTIONS+=(bash -c "/opt/yarn\*/bin/yarn \&\& yarn cypress install \&\& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 18") fi docker run "${DOCKER_OPTIONS[@]}" From 4d04d639471c0ebf333031531cfe1389926d4e42 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Tue, 19 Sep 2023 10:29:57 -0500 Subject: [PATCH 08/29] Updating all bash strings after successful lint run. Adding one Cypress test to BK runner. --- .buildkite/pipelines/pipeline_pull_request_test.yml | 6 ++++++ .buildkite/scripts/pipeline_test.sh | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.buildkite/pipelines/pipeline_pull_request_test.yml b/.buildkite/pipelines/pipeline_pull_request_test.yml index f48ddf661af..05283cc2d07 100644 --- a/.buildkite/pipelines/pipeline_pull_request_test.yml +++ b/.buildkite/pipelines/pipeline_pull_request_test.yml @@ -13,3 +13,9 @@ steps: env: TEST_TYPE: 'unit' if: build.branch != "main" # We're skipping testing commits in main for now to maintain parity with previous Jenkins setup + - command: .buildkite/scripts/pipeline_test.sh + agents: + provider: "gcp" + env: + TEST_TYPE: 'cypress:18' + if: build.branch != "main" # We're skipping testing commits in main for now to maintain parity with previous Jenkins setup diff --git a/.buildkite/scripts/pipeline_test.sh b/.buildkite/scripts/pipeline_test.sh index a037d30e313..40fb260403a 100644 --- a/.buildkite/scripts/pipeline_test.sh +++ b/.buildkite/scripts/pipeline_test.sh @@ -18,16 +18,16 @@ if [[ "${TEST_TYPE}" == 'lint' ]]; then DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" yarn lint") elif [[ "${TEST_TYPE}" == 'unit' ]]; then echo "[TASK]: Running unit tests" - DOCKER_OPTIONS+=(bash -c "/opt/yarn\*/bin/yarn \&\& yarn cypress install \&\& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-unit") + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-unit") elif [[ "${TEST_TYPE}" == 'cypress:16' ]]; then echo "[TASK]: Running Cypress tests against React 16" - DOCKER_OPTIONS+=(bash -c "/opt/yarn\*/bin/yarn \&\& yarn cypress install \&\& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 16") + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 16") elif [[ "${TEST_TYPE}" == 'cypress:17' ]]; then echo "[TASK]: Running Cypress tests against React 17" - DOCKER_OPTIONS+=(bash -c "/opt/yarn\*/bin/yarn \&\& yarn cypress install \&\& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 17") + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 17") elif [[ "${TEST_TYPE}" == 'cypress:18' ]]; then echo "[TASK]: Running Cypress tests against React 18" - DOCKER_OPTIONS+=(bash -c "/opt/yarn\*/bin/yarn \&\& yarn cypress install \&\& NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 18") + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress") fi docker run "${DOCKER_OPTIONS[@]}" From d2a29f43610f6efd9b8f3125a512f1d689fab10f Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Tue, 19 Sep 2023 12:14:06 -0500 Subject: [PATCH 09/29] Adding Cypress runs for React 16 and 17. --- .../pipelines/pipeline_pull_request_test.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.buildkite/pipelines/pipeline_pull_request_test.yml b/.buildkite/pipelines/pipeline_pull_request_test.yml index 05283cc2d07..f5ce8a9aa39 100644 --- a/.buildkite/pipelines/pipeline_pull_request_test.yml +++ b/.buildkite/pipelines/pipeline_pull_request_test.yml @@ -13,9 +13,27 @@ steps: env: TEST_TYPE: 'unit' if: build.branch != "main" # We're skipping testing commits in main for now to maintain parity with previous Jenkins setup + - command: .buildkite/scripts/pipeline_test.sh + agents: + provider: "gcp" + env: + TEST_TYPE: 'cypress:16' + if: build.branch != "main" # We're skipping testing commits in main for now to maintain parity with previous Jenkins setup + artifact_paths: + - "cypress/react16/screenshots/**/*.png" + - command: .buildkite/scripts/pipeline_test.sh + agents: + provider: "gcp" + env: + TEST_TYPE: 'cypress:17' + if: build.branch != "main" # We're skipping testing commits in main for now to maintain parity with previous Jenkins setup + artifact_paths: + - "cypress/react17/screenshots/**/*.png" - command: .buildkite/scripts/pipeline_test.sh agents: provider: "gcp" env: TEST_TYPE: 'cypress:18' if: build.branch != "main" # We're skipping testing commits in main for now to maintain parity with previous Jenkins setup + artifact_paths: + - "cypress/react18/screenshots/**/*.png" From 2818174a45da537ffdf7a282bf335ac30950df87 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Tue, 19 Sep 2023 12:15:14 -0500 Subject: [PATCH 10/29] Refactoring test pipeline to switch case for readability. --- .buildkite/scripts/pipeline_test.sh | 48 +++++++++++++++++++---------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/.buildkite/scripts/pipeline_test.sh b/.buildkite/scripts/pipeline_test.sh index 40fb260403a..f80576cbd43 100644 --- a/.buildkite/scripts/pipeline_test.sh +++ b/.buildkite/scripts/pipeline_test.sh @@ -13,21 +13,37 @@ DOCKER_OPTIONS=( docker.elastic.co/eui/ci:5.3 ) -if [[ "${TEST_TYPE}" == 'lint' ]]; then - echo "[TASK]: Running linters" - DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" yarn lint") -elif [[ "${TEST_TYPE}" == 'unit' ]]; then - echo "[TASK]: Running unit tests" - DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-unit") -elif [[ "${TEST_TYPE}" == 'cypress:16' ]]; then - echo "[TASK]: Running Cypress tests against React 16" - DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 16") -elif [[ "${TEST_TYPE}" == 'cypress:17' ]]; then - echo "[TASK]: Running Cypress tests against React 17" - DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 17") -elif [[ "${TEST_TYPE}" == 'cypress:18' ]]; then - echo "[TASK]: Running Cypress tests against React 18" - DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress") -fi +case $TEST_TYPE in + lint) + echo "[TASK]: Running linters" + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" yarn lint") + ;; + + unit) + echo "[TASK]: Running unit tests" + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-unit") + ;; + + cypress:16) + echo "[TASK]: Running Cypress tests against React 16" + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 16") + ;; + + cypress:17) + echo "[TASK]: Running Cypress tests against React 17" + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 17") + ;; + + cypress:18) + echo "[TASK]: Running Cypress tests against React 18" + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress") + ;; + + *) + echo "[ERROR]: Unknown task" + echo "Exit code: 1" + exit 1 + ;; +esac docker run "${DOCKER_OPTIONS[@]}" From 779c58473a865f2d41238a7829cbc466e96c7645 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Tue, 19 Sep 2023 12:50:59 -0500 Subject: [PATCH 11/29] Labeling steps for task recognition. --- .buildkite/pipelines/pipeline_pull_request_test.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.buildkite/pipelines/pipeline_pull_request_test.yml b/.buildkite/pipelines/pipeline_pull_request_test.yml index f5ce8a9aa39..4f20892efcb 100644 --- a/.buildkite/pipelines/pipeline_pull_request_test.yml +++ b/.buildkite/pipelines/pipeline_pull_request_test.yml @@ -2,18 +2,21 @@ steps: - command: .buildkite/scripts/pipeline_test.sh + label: ":typescript: Linting" agents: provider: "gcp" env: TEST_TYPE: 'lint' if: build.branch != "main" # We're skipping testing commits in main for now to maintain parity with previous Jenkins setup - command: .buildkite/scripts/pipeline_test.sh + label: ":jest: Unit tests" agents: provider: "gcp" env: TEST_TYPE: 'unit' if: build.branch != "main" # We're skipping testing commits in main for now to maintain parity with previous Jenkins setup - command: .buildkite/scripts/pipeline_test.sh + label: ":cypress: Cypress tests on React 16" agents: provider: "gcp" env: @@ -22,6 +25,7 @@ steps: artifact_paths: - "cypress/react16/screenshots/**/*.png" - command: .buildkite/scripts/pipeline_test.sh + label: ":cypress: Cypress tests on React 17" agents: provider: "gcp" env: @@ -30,6 +34,7 @@ steps: artifact_paths: - "cypress/react17/screenshots/**/*.png" - command: .buildkite/scripts/pipeline_test.sh + label: ":cypress: Cypress tests on React 18" agents: provider: "gcp" env: From 09fe4e88a1522c251b641b2521928e5c04bfde9d Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Tue, 19 Sep 2023 13:21:23 -0500 Subject: [PATCH 12/29] Updating comment about branch filter. --- .buildkite/pipelines/pipeline_pull_request_test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.buildkite/pipelines/pipeline_pull_request_test.yml b/.buildkite/pipelines/pipeline_pull_request_test.yml index 4f20892efcb..a983a2f1b75 100644 --- a/.buildkite/pipelines/pipeline_pull_request_test.yml +++ b/.buildkite/pipelines/pipeline_pull_request_test.yml @@ -7,21 +7,21 @@ steps: provider: "gcp" env: TEST_TYPE: 'lint' - if: build.branch != "main" # We're skipping testing commits in main for now to maintain parity with previous Jenkins setup + if: build.branch != "main" # This job is triggered by the combined test and deploy docs for every PR - command: .buildkite/scripts/pipeline_test.sh label: ":jest: Unit tests" agents: provider: "gcp" env: TEST_TYPE: 'unit' - if: build.branch != "main" # We're skipping testing commits in main for now to maintain parity with previous Jenkins setup + if: build.branch != "main" - command: .buildkite/scripts/pipeline_test.sh label: ":cypress: Cypress tests on React 16" agents: provider: "gcp" env: TEST_TYPE: 'cypress:16' - if: build.branch != "main" # We're skipping testing commits in main for now to maintain parity with previous Jenkins setup + if: build.branch != "main" artifact_paths: - "cypress/react16/screenshots/**/*.png" - command: .buildkite/scripts/pipeline_test.sh @@ -30,7 +30,7 @@ steps: provider: "gcp" env: TEST_TYPE: 'cypress:17' - if: build.branch != "main" # We're skipping testing commits in main for now to maintain parity with previous Jenkins setup + if: build.branch != "main" artifact_paths: - "cypress/react17/screenshots/**/*.png" - command: .buildkite/scripts/pipeline_test.sh @@ -39,6 +39,6 @@ steps: provider: "gcp" env: TEST_TYPE: 'cypress:18' - if: build.branch != "main" # We're skipping testing commits in main for now to maintain parity with previous Jenkins setup + if: build.branch != "main" artifact_paths: - "cypress/react18/screenshots/**/*.png" From 7b7983c7f0195376c268d2baeb47f325b5114c9c Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Wed, 20 Sep 2023 13:16:30 -0500 Subject: [PATCH 13/29] Updated Cypress screenshots directory path. --- .buildkite/pipelines/pipeline_pull_request_test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.buildkite/pipelines/pipeline_pull_request_test.yml b/.buildkite/pipelines/pipeline_pull_request_test.yml index a983a2f1b75..e396830f905 100644 --- a/.buildkite/pipelines/pipeline_pull_request_test.yml +++ b/.buildkite/pipelines/pipeline_pull_request_test.yml @@ -23,7 +23,7 @@ steps: TEST_TYPE: 'cypress:16' if: build.branch != "main" artifact_paths: - - "cypress/react16/screenshots/**/*.png" + - "cypress/screenshots/**/*.png" - command: .buildkite/scripts/pipeline_test.sh label: ":cypress: Cypress tests on React 17" agents: @@ -32,7 +32,7 @@ steps: TEST_TYPE: 'cypress:17' if: build.branch != "main" artifact_paths: - - "cypress/react17/screenshots/**/*.png" + - "cypress/screenshots/**/*.png" - command: .buildkite/scripts/pipeline_test.sh label: ":cypress: Cypress tests on React 18" agents: @@ -41,4 +41,4 @@ steps: TEST_TYPE: 'cypress:18' if: build.branch != "main" artifact_paths: - - "cypress/react18/screenshots/**/*.png" + - "cypress/screenshots/**/*.png" From d838ce119d9ca3099e915393453ebb83f6910c3e Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Wed, 20 Sep 2023 13:16:56 -0500 Subject: [PATCH 14/29] Switched commands to use npm so NODE_OPTIONS are available. --- .buildkite/scripts/pipeline_test.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.buildkite/scripts/pipeline_test.sh b/.buildkite/scripts/pipeline_test.sh index f80576cbd43..b2eb5a0db58 100644 --- a/.buildkite/scripts/pipeline_test.sh +++ b/.buildkite/scripts/pipeline_test.sh @@ -16,27 +16,27 @@ DOCKER_OPTIONS=( case $TEST_TYPE in lint) echo "[TASK]: Running linters" - DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" yarn lint") + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run lint") ;; unit) echo "[TASK]: Running unit tests" - DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-unit") + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-unit") ;; cypress:16) echo "[TASK]: Running Cypress tests against React 16" - DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 16") + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-cypress --react-version 16") ;; cypress:17) echo "[TASK]: Running Cypress tests against React 17" - DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress --react-version 17") + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-cypress --react-version 17") ;; cypress:18) echo "[TASK]: Running Cypress tests against React 18" - DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" yarn test-cypress") + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-cypress") ;; *) From fc5da1c62659d0261f311e692d509fc28a5e35a6 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Wed, 20 Sep 2023 13:34:46 -0500 Subject: [PATCH 15/29] Splitting unit tests on TS and TSX file types. --- .buildkite/pipelines/pipeline_pull_request_test.yml | 11 +++++++++-- .buildkite/scripts/pipeline_test.sh | 11 ++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.buildkite/pipelines/pipeline_pull_request_test.yml b/.buildkite/pipelines/pipeline_pull_request_test.yml index e396830f905..7ec2d2a20d5 100644 --- a/.buildkite/pipelines/pipeline_pull_request_test.yml +++ b/.buildkite/pipelines/pipeline_pull_request_test.yml @@ -9,11 +9,18 @@ steps: TEST_TYPE: 'lint' if: build.branch != "main" # This job is triggered by the combined test and deploy docs for every PR - command: .buildkite/scripts/pipeline_test.sh - label: ":jest: Unit tests" + label: ":jest: TS unit tests" agents: provider: "gcp" env: - TEST_TYPE: 'unit' + TEST_TYPE: 'unit:ts' + if: build.branch != "main" + - command: .buildkite/scripts/pipeline_test.sh + label: ":jest: TSX unit tests" + agents: + provider: "gcp" + env: + TEST_TYPE: 'unit:tsx' if: build.branch != "main" - command: .buildkite/scripts/pipeline_test.sh label: ":cypress: Cypress tests on React 16" diff --git a/.buildkite/scripts/pipeline_test.sh b/.buildkite/scripts/pipeline_test.sh index b2eb5a0db58..10ea7e98ca5 100644 --- a/.buildkite/scripts/pipeline_test.sh +++ b/.buildkite/scripts/pipeline_test.sh @@ -19,9 +19,14 @@ case $TEST_TYPE in DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run lint") ;; - unit) - echo "[TASK]: Running unit tests" - DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-unit") + unit:ts) + echo "[TASK]: Running .ts unit tests" + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-unit src/**/*.test.ts") + ;; + + unit:tsx) + echo "[TASK]: Running .tsx unit tests" + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-unit src/**/*.test.tsx") ;; cypress:16) From 50211d834b2d7ccd37ae51e3ae1472dab0a14731 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Wed, 20 Sep 2023 14:10:56 -0500 Subject: [PATCH 16/29] Updating Jest regex to be more inclusive. --- .buildkite/scripts/pipeline_test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.buildkite/scripts/pipeline_test.sh b/.buildkite/scripts/pipeline_test.sh index 10ea7e98ca5..30bc1d5b93f 100644 --- a/.buildkite/scripts/pipeline_test.sh +++ b/.buildkite/scripts/pipeline_test.sh @@ -21,12 +21,12 @@ case $TEST_TYPE in unit:ts) echo "[TASK]: Running .ts unit tests" - DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-unit src/**/*.test.ts") + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-unit **/*.test.ts") ;; unit:tsx) echo "[TASK]: Running .tsx unit tests" - DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-unit src/**/*.test.tsx") + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-unit **/*.test.tsx") ;; cypress:16) From 25d581fe2d809b32523660e9014153e7cac1dcbd Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Wed, 20 Sep 2023 14:20:14 -0500 Subject: [PATCH 17/29] Quoting Jest regex, updating Cypress React version env variable. --- .buildkite/scripts/pipeline_test.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.buildkite/scripts/pipeline_test.sh b/.buildkite/scripts/pipeline_test.sh index 30bc1d5b93f..aa4ec6bbdd9 100644 --- a/.buildkite/scripts/pipeline_test.sh +++ b/.buildkite/scripts/pipeline_test.sh @@ -21,22 +21,22 @@ case $TEST_TYPE in unit:ts) echo "[TASK]: Running .ts unit tests" - DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-unit **/*.test.ts") + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-unit \"**/*.test.ts\"") ;; unit:tsx) echo "[TASK]: Running .tsx unit tests" - DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-unit **/*.test.tsx") + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-unit \"**/*.test.tsx\"") ;; cypress:16) echo "[TASK]: Running Cypress tests against React 16" - DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-cypress --react-version 16") + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" REACT_VERSION=16 npm run test-cypress") ;; cypress:17) echo "[TASK]: Running Cypress tests against React 17" - DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-cypress --react-version 17") + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" REACT_VERSION=17 npm run test-cypress") ;; cypress:18) From 8be998ccc95b12c54aa25ea6600a0d74b7a11b49 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Wed, 20 Sep 2023 15:39:27 -0500 Subject: [PATCH 18/29] Adding commands to package.json for splitting test runs. --- .buildkite/scripts/pipeline_test.sh | 8 ++++---- package.json | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.buildkite/scripts/pipeline_test.sh b/.buildkite/scripts/pipeline_test.sh index aa4ec6bbdd9..033ed4950dc 100644 --- a/.buildkite/scripts/pipeline_test.sh +++ b/.buildkite/scripts/pipeline_test.sh @@ -21,22 +21,22 @@ case $TEST_TYPE in unit:ts) echo "[TASK]: Running .ts unit tests" - DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-unit \"**/*.test.ts\"") + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-unit:ts") ;; unit:tsx) echo "[TASK]: Running .tsx unit tests" - DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-unit \"**/*.test.tsx\"") + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-unit:tsx") ;; cypress:16) echo "[TASK]: Running Cypress tests against React 16" - DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" REACT_VERSION=16 npm run test-cypress") + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-cypress:16") ;; cypress:17) echo "[TASK]: Running Cypress tests against React 17" - DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" REACT_VERSION=17 npm run test-cypress") + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-cypress:17") ;; cypress:18) diff --git a/package.json b/package.json index 883ebdd158f..22695477829 100644 --- a/package.json +++ b/package.json @@ -33,9 +33,13 @@ "test": "yarn lint && yarn test-unit", "test-ci": "yarn test && yarn test-cypress", "test-unit": "cross-env NODE_ENV=test jest --config ./scripts/jest/config.js", + "test-unit:ts": "cross-env NODE_ENV=test jest --config ./scripts/jest/config.js --testMatch **/*.test.ts **/*.test.js", + "test-unit:tsx": "cross-env NODE_ENV=test jest --config ./scripts/jest/config.js --testMatch **/*.test.tsx", "test-a11y": "node ./scripts/a11y-testing", "test-staged": "yarn lint && node scripts/test-staged.js", "test-cypress": "node ./scripts/cypress", + "test-cypress:17": "node ./scripts/cypress --react-version 17", + "test-cypress:16": "node ./scripts/cypress --react-version 16", "test-cypress-dev": "node ./scripts/cypress --dev", "test-cypress-a11y": "node ./scripts/cypress --a11y", "combine-test-coverage": "sh ./scripts/combine-coverage.sh", From 3c73d8a481ad82757ac52264c1e48456ca5075c5 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Thu, 21 Sep 2023 14:34:41 -0500 Subject: [PATCH 19/29] Updated renderHooks to use our React multiple version. --- src/global_styling/functions/typography.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/global_styling/functions/typography.test.tsx b/src/global_styling/functions/typography.test.tsx index b9fda8d6fa4..1b86b3bd811 100644 --- a/src/global_styling/functions/typography.test.tsx +++ b/src/global_styling/functions/typography.test.tsx @@ -7,7 +7,7 @@ */ import React, { FunctionComponent, PropsWithChildren } from 'react'; -import { renderHook } from '@testing-library/react'; +import { renderHook } from '../../test/rtl/render_hook'; import { EuiProvider } from '../../components/provider'; import { useEuiTheme } from '../../services'; From be2d304d8a92c95aa3f44d9651d09985618ec51a Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Thu, 21 Sep 2023 14:57:54 -0500 Subject: [PATCH 20/29] Added an act RTL helper to update one test for React 16, 17. --- src/services/theme/hooks.test.tsx | 4 ++-- src/test/rtl/act.ts | 22 ++++++++++++++++++++++ src/test/rtl/index.ts | 1 + 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 src/test/rtl/act.ts diff --git a/src/services/theme/hooks.test.tsx b/src/services/theme/hooks.test.tsx index 4e9014a290b..b7f56b8540f 100644 --- a/src/services/theme/hooks.test.tsx +++ b/src/services/theme/hooks.test.tsx @@ -7,8 +7,8 @@ */ import React from 'react'; -import { render, act } from '@testing-library/react'; -import { renderHook } from '../../test/rtl'; +import { render } from '@testing-library/react'; +import { act, renderHook } from '../../test/rtl'; import { EuiProvider } from '../../components/provider'; diff --git a/src/test/rtl/act.ts b/src/test/rtl/act.ts new file mode 100644 index 00000000000..5e1bdedc8ed --- /dev/null +++ b/src/test/rtl/act.ts @@ -0,0 +1,22 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import type { act as actType } from '@testing-library/react-hooks'; + +/* eslint-disable @typescript-eslint/no-var-requires */ + +let act: typeof actType; +if (process.env.REACT_VERSION === '18') { + act = require('@testing-library/react').act; +} else { + act = require('@testing-library/react-hooks').act; +} + +/* eslint-enable @typescript-eslint/no-var-requires */ + +export { act }; diff --git a/src/test/rtl/index.ts b/src/test/rtl/index.ts index 80ed2c9d9a1..b1299a41cb4 100644 --- a/src/test/rtl/index.ts +++ b/src/test/rtl/index.ts @@ -16,4 +16,5 @@ export { findByTestSubject, } from './data_test_subj_queries'; export { render, screen, within } from './custom_render'; +export { act } from './act'; export * from './render_hook'; From 1846d1ce666d9c283050fea8b2466656bfa8e23d Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Thu, 21 Sep 2023 15:02:02 -0500 Subject: [PATCH 21/29] Revert "Added an act RTL helper to update one test for React 16, 17." This reverts commit be2d304d8a92c95aa3f44d9651d09985618ec51a. --- src/services/theme/hooks.test.tsx | 4 ++-- src/test/rtl/act.ts | 22 ---------------------- src/test/rtl/index.ts | 1 - 3 files changed, 2 insertions(+), 25 deletions(-) delete mode 100644 src/test/rtl/act.ts diff --git a/src/services/theme/hooks.test.tsx b/src/services/theme/hooks.test.tsx index b7f56b8540f..4e9014a290b 100644 --- a/src/services/theme/hooks.test.tsx +++ b/src/services/theme/hooks.test.tsx @@ -7,8 +7,8 @@ */ import React from 'react'; -import { render } from '@testing-library/react'; -import { act, renderHook } from '../../test/rtl'; +import { render, act } from '@testing-library/react'; +import { renderHook } from '../../test/rtl'; import { EuiProvider } from '../../components/provider'; diff --git a/src/test/rtl/act.ts b/src/test/rtl/act.ts deleted file mode 100644 index 5e1bdedc8ed..00000000000 --- a/src/test/rtl/act.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ - -import type { act as actType } from '@testing-library/react-hooks'; - -/* eslint-disable @typescript-eslint/no-var-requires */ - -let act: typeof actType; -if (process.env.REACT_VERSION === '18') { - act = require('@testing-library/react').act; -} else { - act = require('@testing-library/react-hooks').act; -} - -/* eslint-enable @typescript-eslint/no-var-requires */ - -export { act }; diff --git a/src/test/rtl/index.ts b/src/test/rtl/index.ts index b1299a41cb4..80ed2c9d9a1 100644 --- a/src/test/rtl/index.ts +++ b/src/test/rtl/index.ts @@ -16,5 +16,4 @@ export { findByTestSubject, } from './data_test_subj_queries'; export { render, screen, within } from './custom_render'; -export { act } from './act'; export * from './render_hook'; From 30ce21ded8df0ef236a5deab2db1af8e19a9eca5 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Thu, 21 Sep 2023 15:39:53 -0500 Subject: [PATCH 22/29] Updated test to use multiple version act hook. --- src/services/theme/hooks.test.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/services/theme/hooks.test.tsx b/src/services/theme/hooks.test.tsx index 4e9014a290b..d2cb442fe06 100644 --- a/src/services/theme/hooks.test.tsx +++ b/src/services/theme/hooks.test.tsx @@ -7,8 +7,8 @@ */ import React from 'react'; -import { render, act } from '@testing-library/react'; -import { renderHook } from '../../test/rtl'; +import { render } from '@testing-library/react'; +import { renderHook, renderHookAct } from '../../test/rtl'; import { EuiProvider } from '../../components/provider'; @@ -94,7 +94,7 @@ describe('useEuiThemeCSSVariables', () => { expect(result.current.globalCSSVariables).toBeUndefined(); expect(result.current.themeCSSVariables).toBeUndefined(); - act(() => { + renderHookAct(() => { result.current.setNearestThemeCSSVariables({ '--hello': 'world' }); }); From 0c391c4180cdbb5316938b8cad055a55dc757d97 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Thu, 21 Sep 2023 16:51:49 -0500 Subject: [PATCH 23/29] Updating Jest tests to run on React 17 or 18. --- .../collapsible_nav_beta.test.tsx | 40 ++++++++++++++----- .../controls/keyboard_shortcuts.test.tsx | 32 ++++++++------- .../text_truncate/text_truncate.test.tsx | 18 ++++++--- 3 files changed, 59 insertions(+), 31 deletions(-) diff --git a/src/components/collapsible_nav_beta/collapsible_nav_beta.test.tsx b/src/components/collapsible_nav_beta/collapsible_nav_beta.test.tsx index 4d594b35871..d329c1f5db2 100644 --- a/src/components/collapsible_nav_beta/collapsible_nav_beta.test.tsx +++ b/src/components/collapsible_nav_beta/collapsible_nav_beta.test.tsx @@ -9,7 +9,10 @@ import React from 'react'; import { fireEvent } from '@testing-library/react'; import { render } from '../../test/rtl'; -import { shouldRenderCustomStyles } from '../../test/internal'; +import { + shouldRenderCustomStyles, + testOnReactVersion, +} from '../../test/internal'; import { requiredProps } from '../../test'; import { EuiCollapsibleNavBeta } from './collapsible_nav_beta'; @@ -70,21 +73,36 @@ describe('EuiCollapsibleNavBeta', () => { window.dispatchEvent(new Event('resize')); }; - it('collapses from a push flyout to an overlay flyout once the screen is smaller than 3x the flyout width', () => { - mockWindowResize(600); - const { baseElement } = render( - Nav content - ); - expect(baseElement).toMatchSnapshot(); - }); + testOnReactVersion(['18'])( + 'collapses from a push flyout to an overlay flyout once the screen is smaller than 3x the flyout width', + () => { + mockWindowResize(600); + const { baseElement } = render( + Nav content + ); + expect(baseElement).toMatchSnapshot(); + } + ); + + testOnReactVersion(['18'])( + 'makes the overlay flyout full width once the screen is smaller than 1.5x the flyout width', + () => { + mockWindowResize(320); + const { baseElement } = render( + Nav content + ); + expect(baseElement).toMatchSnapshot(); + } + ); - it('makes the overlay flyout full width once the screen is smaller than 1.5x the flyout width', () => { + it('updates the full width overlay flyout on click and keypress', () => { mockWindowResize(320); - const { baseElement, getByTestSubject } = render( + const { baseElement, getByLabelText, getByTestSubject } = render( Nav content ); + expect(getByLabelText('Toggle navigation open')).toBeInTheDocument(); fireEvent.click(getByTestSubject('euiCollapsibleNavButton')); - expect(baseElement).toMatchSnapshot(); + expect(getByLabelText('Toggle navigation closed')).toBeInTheDocument(); // onClose testing expect( diff --git a/src/components/datagrid/controls/keyboard_shortcuts.test.tsx b/src/components/datagrid/controls/keyboard_shortcuts.test.tsx index d707c5a4896..2178b578490 100644 --- a/src/components/datagrid/controls/keyboard_shortcuts.test.tsx +++ b/src/components/datagrid/controls/keyboard_shortcuts.test.tsx @@ -14,23 +14,27 @@ import { waitForEuiPopoverOpen, } from '../../../test/rtl'; import { useDataGridKeyboardShortcuts } from './keyboard_shortcuts'; +import { testOnReactVersion } from '../../../test/internal'; import { fireEvent } from '@testing-library/react'; describe('useDataGridKeyboardShortcuts', () => { - it('returns a popover containing a list of keyboard shortcuts', async () => { - const { result } = renderHook(() => useDataGridKeyboardShortcuts()); - const { baseElement, getByTestSubject, rerender } = render( -
{result.current.keyboardShortcuts}
- ); + testOnReactVersion(['18'])( + 'returns a popover containing a list of keyboard shortcuts', + async () => { + const { result } = renderHook(() => useDataGridKeyboardShortcuts()); + const { baseElement, getByTestSubject, rerender } = render( +
{result.current.keyboardShortcuts}
+ ); - renderHookAct(() => { - fireEvent.click(getByTestSubject('dataGridKeyboardShortcutsButton')); - }); - rerender( -
{result.current.keyboardShortcuts}
- ); - await waitForEuiPopoverOpen(); + renderHookAct(() => { + fireEvent.click(getByTestSubject('dataGridKeyboardShortcutsButton')); + }); + rerender( +
{result.current.keyboardShortcuts}
+ ); + await waitForEuiPopoverOpen(); - expect(baseElement).toMatchSnapshot(); - }); + expect(baseElement).toMatchSnapshot(); + } + ); }); diff --git a/src/components/text_truncate/text_truncate.test.tsx b/src/components/text_truncate/text_truncate.test.tsx index 7622fc047e5..c0fe2f455e6 100644 --- a/src/components/text_truncate/text_truncate.test.tsx +++ b/src/components/text_truncate/text_truncate.test.tsx @@ -8,7 +8,10 @@ import React from 'react'; import { render } from '../../test/rtl'; -import { shouldRenderCustomStyles } from '../../test/internal'; +import { + shouldRenderCustomStyles, + testOnReactVersion, +} from '../../test/internal'; import { requiredProps } from '../../test'; // Util mocks @@ -46,11 +49,14 @@ describe('EuiTextTruncate', () => { }); describe('resize observer', () => { - it('does not render a resize observer if a width is passed', () => { - const onResize = jest.fn(); - render(); - expect(onResize).not.toHaveBeenCalled(); - }); + testOnReactVersion(['18'])( + 'does not render a resize observer if a width is passed', + () => { + const onResize = jest.fn(); + render(); + expect(onResize).not.toHaveBeenCalled(); + } + ); it('renders a resize observer when no width is passed', () => { const onResize = jest.fn(); From fc16b789f4529d17350b101dd71ba430252d468d Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Thu, 21 Sep 2023 17:03:37 -0500 Subject: [PATCH 24/29] Standardizing Jest CI commands for React 17, 18. --- .buildkite/scripts/pipeline_test.sh | 10 ++++++++++ package.json | 2 ++ 2 files changed, 12 insertions(+) diff --git a/.buildkite/scripts/pipeline_test.sh b/.buildkite/scripts/pipeline_test.sh index 033ed4950dc..01d607a2e7c 100644 --- a/.buildkite/scripts/pipeline_test.sh +++ b/.buildkite/scripts/pipeline_test.sh @@ -24,6 +24,16 @@ case $TEST_TYPE in DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-unit:ts") ;; + unit:tsx:16) + echo "[TASK]: Running .tsx unit tests" + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-unit:tsx:16") + ;; + + unit:tsx:17) + echo "[TASK]: Running .tsx unit tests" + DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-unit:tsx:17") + ;; + unit:tsx) echo "[TASK]: Running .tsx unit tests" DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn cypress install && NODE_OPTIONS=\"--max-old-space-size=2048\" npm run test-unit:tsx") diff --git a/package.json b/package.json index 22695477829..aa133d4b682 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,8 @@ "test-unit": "cross-env NODE_ENV=test jest --config ./scripts/jest/config.js", "test-unit:ts": "cross-env NODE_ENV=test jest --config ./scripts/jest/config.js --testMatch **/*.test.ts **/*.test.js", "test-unit:tsx": "cross-env NODE_ENV=test jest --config ./scripts/jest/config.js --testMatch **/*.test.tsx", + "test-unit:tsx:17": "cross-env NODE_ENV=test REACT_VERSION=17 jest --config ./scripts/jest/config.js --testMatch **/*.test.tsx", + "test-unit:tsx:16": "cross-env NODE_ENV=test REACT_VERSION=16 jest --config ./scripts/jest/config.js --testMatch **/*.test.tsx", "test-a11y": "node ./scripts/a11y-testing", "test-staged": "yarn lint && node scripts/test-staged.js", "test-cypress": "node ./scripts/cypress", From 7ffdcadc20c904aff7751b3814013089a1317ef1 Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Fri, 22 Sep 2023 15:53:10 -0500 Subject: [PATCH 25/29] Adding Enzyme 16 adapter for unit testing against React 16. --- package.json | 1 + scripts/jest/setup/enzyme.js | 4 +- yarn.lock | 311 ++++++++++++++++++++++++++++++++++- 3 files changed, 313 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index aa133d4b682..370a40c27e4 100644 --- a/package.json +++ b/package.json @@ -193,6 +193,7 @@ "dedent": "^0.7.0", "dts-generator": "^3.0.0", "enzyme": "^3.11.0", + "enzyme-adapter-react-16": "^1.15.7", "enzyme-to-json": "^3.5.0", "eslint": "^8.41.0", "eslint-config-prettier": "^8.8.0", diff --git a/scripts/jest/setup/enzyme.js b/scripts/jest/setup/enzyme.js index 334d2c91e74..f60cfdf31ea 100644 --- a/scripts/jest/setup/enzyme.js +++ b/scripts/jest/setup/enzyme.js @@ -11,8 +11,10 @@ if (process.env.REACT_VERSION === '18') { // is not configured to support act()" errors for now // TODO: Remove when enzyme tests are replaced with RTL global.IS_REACT_ACT_ENVIRONMENT = true; -} else { +} else if (process.env.REACT_VERSION === '17') { Adapter = require('@wojtekmaj/enzyme-adapter-react-17'); +} else { + Adapter = require('enzyme-adapter-react-16'); } configure({ adapter: new Adapter() }); diff --git a/yarn.lock b/yarn.lock index 8ef2aad9d05..6d340f4fe84 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5903,6 +5903,21 @@ aggregate-error@^3.0.0: clean-stack "^2.0.0" indent-string "^4.0.0" +airbnb-prop-types@^2.16.0: + version "2.16.0" + resolved "https://registry.yarnpkg.com/airbnb-prop-types/-/airbnb-prop-types-2.16.0.tgz#b96274cefa1abb14f623f804173ee97c13971dc2" + integrity sha512-7WHOFolP/6cS96PhKNrslCLMYAI8yB1Pp6u6XmxozQOiZbsI5ycglZr5cHhBFfuRcQQjzCMith5ZPZdYiJCxUg== + dependencies: + array.prototype.find "^2.1.1" + function.prototype.name "^1.1.2" + is-regex "^1.1.0" + object-is "^1.1.2" + object.assign "^4.1.0" + object.entries "^1.1.2" + prop-types "^15.7.2" + prop-types-exact "^1.2.0" + react-is "^16.13.1" + ajv-errors@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-1.0.0.tgz#ecf021fa108fd17dfb5e6b383f2dd233e31ffc59" @@ -6302,6 +6317,16 @@ array-unique@^0.3.2: resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= +array.prototype.find@^2.1.1: + version "2.2.2" + resolved "https://registry.yarnpkg.com/array.prototype.find/-/array.prototype.find-2.2.2.tgz#e862cf891e725d8f2a10e5e42d750629faaabd32" + integrity sha512-DRumkfW97iZGOfn+lIXbkVrXL04sfYKX+EfOodo8XboR5sxPDVvOjZTF/rysusa9lmhmSOeD6Vp6RKQP+eP4Tg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + es-shim-unscopables "^1.0.0" + array.prototype.flat@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.3.tgz#0de82b426b0318dbfdb940089e38b043d37f6c7b" @@ -6352,6 +6377,19 @@ array.prototype.tosorted@^1.1.1: es-shim-unscopables "^1.0.0" get-intrinsic "^1.1.3" +arraybuffer.prototype.slice@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz#98bd561953e3e74bb34938e77647179dfe6e9f12" + integrity sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw== + dependencies: + array-buffer-byte-length "^1.0.0" + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + get-intrinsic "^1.2.1" + is-array-buffer "^3.0.2" + is-shared-array-buffer "^1.0.2" + arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" @@ -9064,6 +9102,15 @@ defer-to-connect@^2.0.0: resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg== +define-data-property@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.0.tgz#0db13540704e1d8d479a0656cf781267531b9451" + integrity sha512-UzGwzcjyv3OtAvolTj1GoyNYzfFR+iqbGjcnBEENZVCpM4/Ng1yhGNvS3lR/xDS74Tb2wGG9WzNSNIOS9UVb2g== + dependencies: + get-intrinsic "^1.2.1" + gopd "^1.0.1" + has-property-descriptors "^1.0.0" + define-lazy-prop@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f" @@ -9667,6 +9714,34 @@ envinfo@^7.7.3: resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.8.1.tgz#06377e3e5f4d379fea7ac592d5ad8927e0c4d475" integrity sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw== +enzyme-adapter-react-16@^1.15.7: + version "1.15.7" + resolved "https://registry.yarnpkg.com/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.15.7.tgz#a737e6d8e2c147e9da5acf957755be7634f76201" + integrity sha512-LtjKgvlTc/H7adyQcj+aq0P0H07LDL480WQl1gU512IUyaDo/sbOaNDdZsJXYW2XaoPqrLLE9KbZS+X2z6BASw== + dependencies: + enzyme-adapter-utils "^1.14.1" + enzyme-shallow-equal "^1.0.5" + has "^1.0.3" + object.assign "^4.1.4" + object.values "^1.1.5" + prop-types "^15.8.1" + react-is "^16.13.1" + react-test-renderer "^16.0.0-0" + semver "^5.7.0" + +enzyme-adapter-utils@^1.14.1: + version "1.14.1" + resolved "https://registry.yarnpkg.com/enzyme-adapter-utils/-/enzyme-adapter-utils-1.14.1.tgz#f30db15dafc22e0ccd44f5acc8d93be29218cdcf" + integrity sha512-JZgMPF1QOI7IzBj24EZoDpaeG/p8Os7WeBZWTJydpsH7JRStc7jYbHE4CmNQaLqazaGFyLM8ALWA3IIZvxW3PQ== + dependencies: + airbnb-prop-types "^2.16.0" + function.prototype.name "^1.1.5" + has "^1.0.3" + object.assign "^4.1.4" + object.fromentries "^2.0.5" + prop-types "^15.8.1" + semver "^5.7.1" + enzyme-shallow-equal@^1.0.0, enzyme-shallow-equal@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/enzyme-shallow-equal/-/enzyme-shallow-equal-1.0.4.tgz#b9256cb25a5f430f9bfe073a84808c1d74fced2e" @@ -9675,6 +9750,14 @@ enzyme-shallow-equal@^1.0.0, enzyme-shallow-equal@^1.0.1: has "^1.0.3" object-is "^1.1.2" +enzyme-shallow-equal@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/enzyme-shallow-equal/-/enzyme-shallow-equal-1.0.5.tgz#5528a897a6ad2bdc417c7221a7db682cd01711ba" + integrity sha512-i6cwm7hN630JXenxxJFBKzgLC3hMTafFQXflvzHgPmDhOBhxUWDe8AeRv1qp2/uWJ2Y8z5yLWMzmAfkTOiOCZg== + dependencies: + has "^1.0.3" + object-is "^1.1.5" + enzyme-to-json@^3.5.0: version "3.6.2" resolved "https://registry.yarnpkg.com/enzyme-to-json/-/enzyme-to-json-3.6.2.tgz#94f85c413bcae8ab67be53b0a94b69a560e27823" @@ -9827,6 +9910,51 @@ es-abstract@^1.20.4, es-abstract@^1.21.2: unbox-primitive "^1.0.2" which-typed-array "^1.1.9" +es-abstract@^1.22.1: + version "1.22.2" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.22.2.tgz#90f7282d91d0ad577f505e423e52d4c1d93c1b8a" + integrity sha512-YoxfFcDmhjOgWPWsV13+2RNjq1F6UQnfs+8TftwNqtzlmFzEXvlUwdrNrYeaizfjQzRMxkZ6ElWMOJIFKdVqwA== + dependencies: + array-buffer-byte-length "^1.0.0" + arraybuffer.prototype.slice "^1.0.2" + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + es-set-tostringtag "^2.0.1" + es-to-primitive "^1.2.1" + function.prototype.name "^1.1.6" + get-intrinsic "^1.2.1" + get-symbol-description "^1.0.0" + globalthis "^1.0.3" + gopd "^1.0.1" + has "^1.0.3" + has-property-descriptors "^1.0.0" + has-proto "^1.0.1" + has-symbols "^1.0.3" + internal-slot "^1.0.5" + is-array-buffer "^3.0.2" + is-callable "^1.2.7" + is-negative-zero "^2.0.2" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.2" + is-string "^1.0.7" + is-typed-array "^1.1.12" + is-weakref "^1.0.2" + object-inspect "^1.12.3" + object-keys "^1.1.1" + object.assign "^4.1.4" + regexp.prototype.flags "^1.5.1" + safe-array-concat "^1.0.1" + safe-regex-test "^1.0.0" + string.prototype.trim "^1.2.8" + string.prototype.trimend "^1.0.7" + string.prototype.trimstart "^1.0.7" + typed-array-buffer "^1.0.0" + typed-array-byte-length "^1.0.0" + typed-array-byte-offset "^1.0.0" + typed-array-length "^1.0.4" + unbox-primitive "^1.0.2" + which-typed-array "^1.1.11" + es-array-method-boxes-properly@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz#873f3e84418de4ee19c5be752990b2e44718d09e" @@ -11241,6 +11369,16 @@ function.prototype.name@^1.1.0, function.prototype.name@^1.1.2, function.prototy es-abstract "^1.19.0" functions-have-names "^1.2.2" +function.prototype.name@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.6.tgz#cdf315b7d90ee77a4c6ee216c3c3362da07533fd" + integrity sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + functions-have-names "^1.2.3" + functions-have-names@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.2.tgz#98d93991c39da9361f8e50b337c4f6e41f120e21" @@ -11324,6 +11462,16 @@ get-intrinsic@^1.1.3, get-intrinsic@^1.2.0: has "^1.0.3" has-symbols "^1.0.3" +get-intrinsic@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.1.tgz#d295644fed4505fc9cde952c37ee12b477a83d82" + integrity sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-proto "^1.0.1" + has-symbols "^1.0.3" + get-nonce@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/get-nonce/-/get-nonce-1.0.1.tgz#fdf3f0278073820d2ce9426c18f07481b1e0cdf3" @@ -13238,7 +13386,7 @@ is-redirect@^1.0.0: resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" integrity sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ= -is-regex@^1.0.5, is-regex@^1.1.4: +is-regex@^1.0.5, is-regex@^1.1.0, is-regex@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== @@ -13349,6 +13497,13 @@ is-typed-array@^1.1.10, is-typed-array@^1.1.3, is-typed-array@^1.1.9: gopd "^1.0.1" has-tostringtag "^1.0.0" +is-typed-array@^1.1.12: + version "1.1.12" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.12.tgz#d0bab5686ef4a76f7a73097b95470ab199c57d4a" + integrity sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg== + dependencies: + which-typed-array "^1.1.11" + is-typedarray@^1.0.0, is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" @@ -16203,6 +16358,15 @@ object.entries@^1.1.1: es-abstract "^1.17.5" has "^1.0.3" +object.entries@^1.1.2: + version "1.1.7" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.7.tgz#2b47760e2a2e3a752f39dd874655c61a7f03c131" + integrity sha512-jCBs/0plmPsOnrKAfFQXRG2NFjlhZgjjcBLSmTnEhU8U6vVTsVe8ANeQJCHTl3gSsI4J+0emOoCgoKlmQPMgmA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + object.entries@^1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.6.tgz#9737d0e5b8291edd340a3e3264bb8a3b00d5fa23" @@ -16221,6 +16385,15 @@ object.fromentries@^2.0.0, object.fromentries@^2.0.6: define-properties "^1.1.4" es-abstract "^1.20.4" +object.fromentries@^2.0.5: + version "2.0.7" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.7.tgz#71e95f441e9a0ea6baf682ecaaf37fa2a8d7e616" + integrity sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + object.getownpropertydescriptors@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz#369bf1f9592d8ab89d712dced5cb81c7c5352649" @@ -16265,6 +16438,15 @@ object.values@^1.1.0, object.values@^1.1.1: function-bind "^1.1.1" has "^1.0.3" +object.values@^1.1.5: + version "1.1.7" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.7.tgz#617ed13272e7e1071b43973aa1655d9291b8442a" + integrity sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + object.values@^1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.6.tgz#4abbaa71eba47d63589d402856f908243eea9b1d" @@ -17709,6 +17891,15 @@ prompts@^2.4.0: kleur "^3.0.3" sisteransi "^1.0.5" +prop-types-exact@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/prop-types-exact/-/prop-types-exact-1.2.0.tgz#825d6be46094663848237e3925a98c6e944e9869" + integrity sha512-K+Tk3Kd9V0odiXFP9fwDHUYRyvK3Nun3GVyPapSIs5OBkITAm15W0CPFD/YKTkMUAbc0b9CUwRQp2ybiBIq+eA== + dependencies: + has "^1.0.3" + object.assign "^4.1.0" + reflect.ownkeys "^0.2.0" + prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.7.0, prop-types@^15.7.2, prop-types@^15.8.1: version "15.8.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" @@ -18169,7 +18360,7 @@ react-is@18.1.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.1.0.tgz#61aaed3096d30eacf2a2127118b5b41387d32a67" integrity sha512-Fl7FuabXsJnV5Q1qIOQwx/sagGF18kogb4gpfcG4gjLBWO0WDiiz1ko/ExayuxE7InyQkBLkxRFG5oxY6Uu3Kg== -react-is@^16.12.0, react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.4: +react-is@^16.12.0, react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.4, react-is@^16.8.6: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== @@ -18305,6 +18496,16 @@ react-style-singleton@^2.2.0, react-style-singleton@^2.2.1: invariant "^2.2.4" tslib "^2.0.0" +react-test-renderer@^16.0.0-0: + version "16.14.0" + resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.14.0.tgz#e98360087348e260c56d4fe2315e970480c228ae" + integrity sha512-L8yPjqPE5CZO6rKsKXRO/rVPiaCOy0tQQJbC+UjPNlobl5mad59lvPjwFsQHTvL03caVDIVr9x9/OSgDe6I5Eg== + dependencies: + object-assign "^4.1.1" + prop-types "^15.6.2" + react-is "^16.8.6" + scheduler "^0.19.1" + react-test-renderer@^17.0.0: version "17.0.2" resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-17.0.2.tgz#4cd4ae5ef1ad5670fc0ef776e8cc7e1231d9866c" @@ -18572,6 +18773,11 @@ redux@^4.0.5, redux@^4.2.1: dependencies: "@babel/runtime" "^7.9.2" +reflect.ownkeys@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/reflect.ownkeys/-/reflect.ownkeys-0.2.0.tgz#749aceec7f3fdf8b63f927a04809e90c5c0b3460" + integrity sha512-qOLsBKHCpSOFKK1NUOCGC5VyeufB6lEsFe92AL2bhIJsacZS1qdoOZSbPk3MYKuT2cFlRDnulKXuuElIrMjGUg== + refractor@^3.5.0: version "3.5.0" resolved "https://registry.yarnpkg.com/refractor/-/refractor-3.5.0.tgz#334586f352dda4beaf354099b48c2d18e0819aec" @@ -18646,6 +18852,15 @@ regexp.prototype.flags@^1.4.3, regexp.prototype.flags@^1.5.0: define-properties "^1.2.0" functions-have-names "^1.2.3" +regexp.prototype.flags@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz#90ce989138db209f81492edd734183ce99f9677e" + integrity sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + set-function-name "^2.0.0" + regexpu-core@^5.3.1: version "5.3.2" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.3.2.tgz#11a2b06884f3527aec3e93dbbf4a3b958a95546b" @@ -19214,6 +19429,16 @@ safe-array-concat@^1.0.0: has-symbols "^1.0.3" isarray "^2.0.5" +safe-array-concat@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/safe-array-concat/-/safe-array-concat-1.0.1.tgz#91686a63ce3adbea14d61b14c99572a8ff84754c" + integrity sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.1" + has-symbols "^1.0.3" + isarray "^2.0.5" + safe-buffer@5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" @@ -19433,6 +19658,11 @@ semver@5.5.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" integrity sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA== +semver@^5.7.0: + version "5.7.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" + integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== + semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" @@ -19548,6 +19778,15 @@ set-blocking@^2.0.0: resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= +set-function-name@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-function-name/-/set-function-name-2.0.1.tgz#12ce38b7954310b9f61faa12701620a0c882793a" + integrity sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA== + dependencies: + define-data-property "^1.0.1" + functions-have-names "^1.2.3" + has-property-descriptors "^1.0.0" + set-getter@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/set-getter/-/set-getter-0.1.0.tgz#d769c182c9d5a51f409145f2fba82e5e86e80376" @@ -20236,6 +20475,15 @@ string.prototype.trim@^1.2.7: define-properties "^1.1.4" es-abstract "^1.20.4" +string.prototype.trim@^1.2.8: + version "1.2.8" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz#f9ac6f8af4bd55ddfa8895e6aea92a96395393bd" + integrity sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + string.prototype.trimend@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" @@ -20253,6 +20501,15 @@ string.prototype.trimend@^1.0.6: define-properties "^1.1.4" es-abstract "^1.20.4" +string.prototype.trimend@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz#1bb3afc5008661d73e2dc015cd4853732d6c471e" + integrity sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + string.prototype.trimstart@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed" @@ -20270,6 +20527,15 @@ string.prototype.trimstart@^1.0.6: define-properties "^1.1.4" es-abstract "^1.20.4" +string.prototype.trimstart@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz#d4cdb44b83a4737ffbac2d406e405d43d0184298" + integrity sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + es-abstract "^1.22.1" + string_decoder@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d" @@ -21272,6 +21538,36 @@ type-is@~1.6.18: media-typer "0.3.0" mime-types "~2.1.24" +typed-array-buffer@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz#18de3e7ed7974b0a729d3feecb94338d1472cd60" + integrity sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.1" + is-typed-array "^1.1.10" + +typed-array-byte-length@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz#d787a24a995711611fb2b87a4052799517b230d0" + integrity sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA== + dependencies: + call-bind "^1.0.2" + for-each "^0.3.3" + has-proto "^1.0.1" + is-typed-array "^1.1.10" + +typed-array-byte-offset@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz#cbbe89b51fdef9cd6aaf07ad4707340abbc4ea0b" + integrity sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + for-each "^0.3.3" + has-proto "^1.0.1" + is-typed-array "^1.1.10" + typed-array-length@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/typed-array-length/-/typed-array-length-1.0.4.tgz#89d83785e5c4098bec72e08b319651f0eac9c1bb" @@ -22319,6 +22615,17 @@ which-pm@2.0.0: load-yaml-file "^0.2.0" path-exists "^4.0.0" +which-typed-array@^1.1.11: + version "1.1.11" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.11.tgz#99d691f23c72aab6768680805a271b69761ed61a" + integrity sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + for-each "^0.3.3" + gopd "^1.0.1" + has-tostringtag "^1.0.0" + which-typed-array@^1.1.2, which-typed-array@^1.1.9: version "1.1.9" resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.9.tgz#307cf898025848cf995e795e8423c7f337efbde6" From ba2bd126ce20a97ffe86f3009f0da62886929f1e Mon Sep 17 00:00:00 2001 From: 1Copenut Date: Fri, 22 Sep 2023 15:54:08 -0500 Subject: [PATCH 26/29] Updated unit tests and snapshots to pass runs on React 16. Still two failures in unit tests. --- .../collapsible_nav_beta.test.tsx.snap | 49 +-- .../collapsible_nav_beta.test.tsx | 2 +- .../column_selector.test.tsx.snap | 299 +----------------- .../column_sorting.test.tsx.snap | 294 +---------------- .../column_sorting_draggable.test.tsx.snap | 161 +--------- .../controls/column_selector.test.tsx | 4 +- .../datagrid/controls/column_sorting.test.tsx | 4 +- .../column_sorting_draggable.test.tsx | 4 +- .../drag_and_drop/draggable.test.tsx | 3 +- .../drag_and_drop/droppable.test.tsx | 3 +- 10 files changed, 21 insertions(+), 802 deletions(-) diff --git a/src/components/collapsible_nav_beta/__snapshots__/collapsible_nav_beta.test.tsx.snap b/src/components/collapsible_nav_beta/__snapshots__/collapsible_nav_beta.test.tsx.snap index ca97480a43d..8c6e714d5e0 100644 --- a/src/components/collapsible_nav_beta/__snapshots__/collapsible_nav_beta.test.tsx.snap +++ b/src/components/collapsible_nav_beta/__snapshots__/collapsible_nav_beta.test.tsx.snap @@ -138,7 +138,7 @@ exports[`EuiCollapsibleNavBeta responsive behavior collapses from a push flyout exports[`EuiCollapsibleNavBeta responsive behavior makes the overlay flyout full width once the screen is smaller than 1.5x the flyout width 1`] = `
@@ -147,9 +147,9 @@ exports[`EuiCollapsibleNavBeta responsive behavior makes the overlay flyout full >
-
-
-
- -
-
-
`; diff --git a/src/components/collapsible_nav_beta/collapsible_nav_beta.test.tsx b/src/components/collapsible_nav_beta/collapsible_nav_beta.test.tsx index d329c1f5db2..f29d34bfdf3 100644 --- a/src/components/collapsible_nav_beta/collapsible_nav_beta.test.tsx +++ b/src/components/collapsible_nav_beta/collapsible_nav_beta.test.tsx @@ -95,7 +95,7 @@ describe('EuiCollapsibleNavBeta', () => { } ); - it('updates the full width overlay flyout on click and keypress', () => { + it('dauptes the overlay controls once the screen is smaller than 1.5x the flyout width', () => { mockWindowResize(320); const { baseElement, getByLabelText, getByTestSubject } = render( Nav content diff --git a/src/components/datagrid/controls/__snapshots__/column_selector.test.tsx.snap b/src/components/datagrid/controls/__snapshots__/column_selector.test.tsx.snap index e1e8d65ead3..877a06126f9 100644 --- a/src/components/datagrid/controls/__snapshots__/column_selector.test.tsx.snap +++ b/src/components/datagrid/controls/__snapshots__/column_selector.test.tsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`useDataGridColumnSelector columnSelector [React 17] renders a toolbar button/popover allowing users to set column visibility and order 1`] = ` +exports[`useDataGridColumnSelector columnSelector renders a toolbar button/popover allowing users to set column visibility and order 1`] = `
`; -exports[`useDataGridColumnSelector columnSelector [React 17] renders a toolbar button/popover allowing users to set column visibility and order 2`] = ` -