Skip to content

Commit

Permalink
fix: animation wait for InputSelect
Browse files Browse the repository at this point in the history
  • Loading branch information
aziolek committed Jan 15, 2025
1 parent 7e0ce74 commit cecd563
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions client/cypress/e2e/_21projects.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
});
});

Expand All @@ -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);
});

Expand Down
2 changes: 1 addition & 1 deletion client/src/components/ui/InputSelect/InputSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<InputSelectProps> = ({
className,
Expand Down

0 comments on commit cecd563

Please sign in to comment.