From cecd563818c06bf6840053b399af17c6597ee1db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20Zi=C3=B3=C5=82ek?= Date: Wed, 15 Jan 2025 21:27:20 +0100 Subject: [PATCH] fix: animation wait for InputSelect --- client/cypress/e2e/_21projects.cy.ts | 9 ++++++--- client/src/components/ui/InputSelect/InputSelect.tsx | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/client/cypress/e2e/_21projects.cy.ts b/client/cypress/e2e/_21projects.cy.ts index 6a767b1b6..6cb938b23 100644 --- a/client/cypress/e2e/_21projects.cy.ts +++ b/client/cypress/e2e/_21projects.cy.ts @@ -11,6 +11,7 @@ import { } from 'cypress/utils/e2e'; import { getNamesOfProjects } from 'cypress/utils/projects'; import viewports from 'cypress/utils/viewports'; +import { durationOfTransitionMobile } from 'src/components/ui/InputSelect/InputSelect'; import { HAS_ONBOARDING_BEEN_CLOSED, IS_CRYPTO_MAIN_VALUE_DISPLAY, @@ -255,7 +256,11 @@ Object.values(viewports).forEach( const orderOptionsValues = ORDER_OPTIONS((key: string) => {}).map(element => element.value); orderOptionsValues.forEach(orderOptionsValue => { cy.get('[data-test=ProjectsView__InputSelect]').click(); + // Wait for animation to show / hide menu & overflow. + cy.wait(durationOfTransitionMobile * 1000 * 2); cy.get(`[data-test=ProjectsView__InputSelect__Option--${orderOptionsValue}]`).click(); + // Wait for animation to show / hide menu & overflow. + cy.wait(durationOfTransitionMobile * 1000 * 2); }); }); @@ -274,9 +279,7 @@ Object.values(viewports).forEach( * Assumption here is that any project in current epoch will have "a" letter in their name, * which is very likely. */ - cy.get('[data-test=ProjectsList__InputText]') - .clear() - .type(`a Epoch 1`); + cy.get('[data-test=ProjectsList__InputText]').clear().type(`a Epoch 1`); cy.get('[data-test^=ProjectsSearchResults__ProjectsListItem]').should('have.length.gt', 1); }); diff --git a/client/src/components/ui/InputSelect/InputSelect.tsx b/client/src/components/ui/InputSelect/InputSelect.tsx index ac88038ea..4f88579ff 100644 --- a/client/src/components/ui/InputSelect/InputSelect.tsx +++ b/client/src/components/ui/InputSelect/InputSelect.tsx @@ -12,7 +12,7 @@ import styles from './InputSelect.module.scss'; import InputSelectProps, { Option } from './types'; const durationOfTransitionDesktop = 0; -const durationOfTransitionMobile = 0.3; +export const durationOfTransitionMobile = 0.3; const InputSelect: FC = ({ className,