Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCT-2135: Home Epoch Results Graph E2E #608

Merged
merged 4 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion client/cypress/e2e/_16allocationAWOpen.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { ROOT_ROUTES } from 'src/routes/RootRoutes/routes';
chai.use(chaiColors);

Object.values(viewports).forEach(
({ device, viewportWidth, viewportHeight, isLargeDesktop, isDesktop }, idx) => {
({ device, viewportWidth, viewportHeight, isLargeDesktop, isDesktop, isMobile }, idx) => {
describe(`[AW IS OPEN] Allocation: ${device}`, { viewportHeight, viewportWidth }, () => {
before(() => {
/**
Expand Down Expand Up @@ -541,6 +541,31 @@ Object.values(viewports).forEach(
cy.get('[data-test=WithdrawEth__Button]').invoke('text').should('eq', 'Withdraw all');
cy.get('[data-test=WithdrawEth__Button]').should('be.disabled');
});

it('Epoch results graph shows donated projects', () => {
connectWallet({ isPatronModeEnabled: false });
cy.wait(5000);

cy.get('[data-test=EpochResults__Img--headphonesGirl]').should('not.exist');
cy.get('[data-test=EpochResultsDetails]').should('be.visible');
cy.get('[data-test=EpochResultsDetails__loading]').should('not.exist');
cy.get('[data-test=EpochResultsBar]').should('have.length', 4);

if (isMobile) {
cy.get('[data-test=EpochResultsBar]').eq(0).click();
} else {
cy.get('[data-test=EpochResultsBar]').eq(0).trigger('mouseover');
}

cy.get('[data-test=EpochResultsBar__projectLogo]').should('be.visible');
cy.get('[data-test=EpochResultsDetails__projectName]').should('be.visible');
cy.get('[data-test=EpochResultsDetails__donations]').should('be.visible');
cy.get('[data-test=EpochResultsDetails__matching]').should('be.visible');
cy.get('[data-test=EpochResultsDetails__total]').should('be.visible');
if (!isMobile) {
cy.get('[data-test=EpochResultsDetails__Button--visitProject]').should('be.visible');
}
});
});

describe('move time - AW IS CLOSED', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ const EpochResults: FC<EpochResultsProps> = ({
}, [isLoading]);

return (
<div className={styles.root}>
<div className={styles.root} data-test="EpochResults">
<div
ref={graphContainerRef}
className={cx(styles.graphContainer, isLoading && styles.isLoading)}
Expand All @@ -198,7 +198,11 @@ const EpochResults: FC<EpochResultsProps> = ({
}}
>
{isLoading ? (
<Img className={styles.image} src="/images/headphones_girl.webp" />
<Img
className={styles.image}
data-test="EpochResults__Img--headphonesGirl"
src="/images/headphones_girl.webp"
/>
) : (
<div className={styles.barsContainer}>
{projects.map(({ address, matchedRewards, donations, profileImageSmall }) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const EpochResultsBar: FC<EpochResultsBarProps> = ({
<motion.div
ref={ref}
className={cx(styles.root, topBarHeightPercentage && styles.hasValue)}
data-test="EpochResultsBar"
id={EPOCH_RESULTS_BAR_ID}
onClick={e => {
e.stopPropagation();
Expand Down Expand Up @@ -79,6 +80,7 @@ const EpochResultsBar: FC<EpochResultsBarProps> = ({
scale: 1,
}}
className={styles.projectLogo}
data-test="EpochResultsBar__projectLogo"
exit={{
opacity: 0,
scale: 0.5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ const EpochResultsDetails: FC<EpochResultsDetailsProps> = ({
<div
ref={ref}
className={styles.root}
data-test="EpochResultsDetails"
onMouseDown={e => {
if (!isScrollable) {
return;
Expand Down Expand Up @@ -152,7 +153,7 @@ const EpochResultsDetails: FC<EpochResultsDetailsProps> = ({
}}
>
{isLoading && (
<div className={styles.loading}>
<div className={styles.loading} data-test="EpochResultsDetails__loading">
{t('loadingChartData')}
{[...Array(dots).keys()].map(key => (
<span key={`dot__${key}`}>.</span>
Expand All @@ -170,25 +171,28 @@ const EpochResultsDetails: FC<EpochResultsDetailsProps> = ({
)}
{!isScrollInfoVisible && details && (
<>
<div className={styles.projectName}>{details.name}</div>
<div className={styles.donations}>
<div className={styles.projectName} data-test="EpochResultsDetails__projectName">
{details.name}
</div>
<div className={styles.donations} data-test="EpochResultsDetails__donations">
{isMobile ? t('donationsShort') : i18n.t('common.donations')}
{isMobile ? '' : ' '}
{donationsToDisplay}
</div>
<div className={styles.matching}>
<div className={styles.matching} data-test="EpochResultsDetails__matching">
{isMobile ? t('matchingShort') : i18n.t('common.matching')}
{isMobile ? '' : ' '}
{matchingToDisplay}
</div>
<div className={styles.total}>
<div className={styles.total} data-test="EpochResultsDetails__total">
{isMobile ? t('totalShort') : i18n.t('common.total')}
{isMobile ? '' : ' '}
{totalToDisplay}
</div>
{!isMobile && (
<Button
className={styles.link}
dataTest="EpochResultsDetails__Button--visitProject"
isDisabled
onMouseOver={e => e.stopPropagation()}
variant="link"
Expand Down
Loading