Skip to content

Commit

Permalink
Merge branch 'master' into feature/oct-2097-social-media-buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
jmikolajczyk committed Jan 13, 2025
2 parents 447885f + b5e6c40 commit 05f9b42
Show file tree
Hide file tree
Showing 13 changed files with 162 additions and 119 deletions.
2 changes: 1 addition & 1 deletion backend/app/modules/score_delegation/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from app.modules.common.delegation import HashedAddresses, hash_addresses
from app.modules.dto import ScoreDelegationPayload

MIN_SCORE = 20
MIN_SCORE = 15


class ActionType(Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def test_score_is_too_low():
core.verify_score_delegation(
hashed_addresses,
set(),
19.9,
14.9,
0,
core.ActionType.DELEGATION,
USER1_ADDRESS,
Expand Down
14 changes: 7 additions & 7 deletions ci/argocd/contracts/master.env
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
BLOCK_NUMBER=7447731
BLOCK_NUMBER=7461476
GLM_CONTRACT_ADDRESS=0x71432DD1ae7DB41706ee6a22148446087BdD0906
AUTH_CONTRACT_ADDRESS=0x5c7Aa9Ea5244D392812794DEEd048C2D245F1A89
DEPOSITS_CONTRACT_ADDRESS=0x9EB0260d78C8e9E22B88E76e18cCEffb7FDF58e0
EPOCHS_CONTRACT_ADDRESS=0x211D0a1d39ab60979CF057594636CCe45c905F2C
PROPOSALS_CONTRACT_ADDRESS=0x8597d78293bCE387D402852872a46a5ED7c35D29
WITHDRAWALS_TARGET_CONTRACT_ADDRESS=0x7E3e912256b3E049a0e5730D8E560E4115553320
VAULT_CONTRACT_ADDRESS=0xbC12768CCeB4682270D00F33Af8Ed06c2122E079
AUTH_CONTRACT_ADDRESS=0xcb3ce71C4BCAC5A7A7291A45aee92cF98ce8b72a
DEPOSITS_CONTRACT_ADDRESS=0x3E192dC32B7d3338F93790D9d9DE92Ce2B3F44C2
EPOCHS_CONTRACT_ADDRESS=0x2365fB270cd2D9207157ff36BdE7AFa4936EBf0c
PROPOSALS_CONTRACT_ADDRESS=0x079a8319eAD69f371E13c569aD46BeB2032c815d
WITHDRAWALS_TARGET_CONTRACT_ADDRESS=0x457cc2B737B2709842B2FFebA4AD8c6A1375367D
VAULT_CONTRACT_ADDRESS=0xAD05952c5890E1085E4Bcf2BAf1794E2050c0897
168 changes: 83 additions & 85 deletions client/cypress/e2e/_07onboardingTOSNotAccepted.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,91 +21,89 @@ import {

chai.use(chaiColors);

Object.values(viewports).forEach(({ device, viewportWidth, viewportHeight }, index, arr) => {
describe(
`[AW IS CLOSED] Onboarding (TOS not accepted): ${device}`,
{ viewportHeight, viewportWidth },
() => {
before(() => {
beforeSetup();
});

beforeEach(() => {
connectWalletOnboarding();
});

after(() => {
cy.disconnectMetamaskWalletFromAllDapps();
});

it('onboarding TOS step should be first and active', () => {
checkCurrentElement(0, true);
cy.get('[data-test=ModalOnboardingTOS]').should('be.visible');
});

it('user is not able to click through entire onboarding flow', () => {
cy.window().then(win => {
const isDecisionWindowOpen = win.clientReactQuery.getQueryData(
QUERY_KEYS.isDecisionWindowOpen,
);

const onboardingSteps = isDecisionWindowOpen
? getStepsDecisionWindowOpen('2', '16 Jan')
: getStepsDecisionWindowClosed('2', '16 Jan');

for (let i = 1; i < onboardingSteps.length; i++) {
checkProgressStepperSlimIsCurrentAndClickNext(i, i === 1);
}
Object.values(viewports).forEach(
({ device, viewportWidth, viewportHeight, isMobile }, index, arr) => {
describe(
`[AW IS CLOSED] Onboarding (TOS not accepted): ${device}`,
{ viewportHeight, viewportWidth },
() => {
before(() => {
beforeSetup();
});
});

it('user is not able to close the modal by clicking button in the top-right', () => {
cy.get('[data-test=ModalOnboarding]').should('be.visible');
cy.get('[data-test=ModalOnboarding__Button]').click({ force: true });
cy.get('[data-test=ModalOnboarding]').should('be.visible');
});

it('renders every time page is refreshed', () => {
cy.get('[data-test=ModalOnboarding]').should('be.visible');
cy.reload();
cy.get('[data-test=ModalOnboarding]').should('be.visible');
});

it('user cannot change steps with arrow keys (left, right)', () => {
checkChangeStepsWithArrowKeys(false);
});

// TODO will be unskipped in https://github.com/golemfoundation/octant/pull/624.
// eslint-disable-next-line
it('user cannot change steps by clicking the edge of the screen (up to 25px from each edge)', () => {
checkChangeStepsByClickingEdgeOfTheScreenUpTo25px(false);
});

// TODO will be unskipped in https://github.com/golemfoundation/octant/pull/624.
// eslint-disable-next-line
it('user cannot change steps by clicking the edge of the screen (more than 25px from each edge)', () => {
checkChangeStepsByClickingEdgeOfTheScreenMoreThan25px(false);
});

it('user cannot change steps by swiping on screen (difference more than or equal 5px)', () => {
checkChangeStepsBySwipingOnScreenDifferenceMoreThanOrEqual5px(false);
});

it('user cannot change steps by swiping on screen (difference less than 5px)', () => {
checkChangeStepsBySwipingOnScreenDifferenceLessThanl5px(false);
});

if (index === arr.length - 1) {
it('TOS acceptance changes onboarding step to next step and allows the user to close the modal by clicking button in the top-right', () => {

beforeEach(() => {
connectWalletOnboarding();
});

after(() => {
cy.disconnectMetamaskWalletFromAllDapps();
});

it('onboarding TOS step should be first and active', () => {
checkCurrentElement(0, true);
cy.get('[data-test=TOS_InputCheckbox]').check();
cy.switchToMetamaskNotification();
cy.confirmMetamaskSignatureRequest();
checkCurrentElement(1, true);
cy.get('[data-test=ModalOnboarding__Button]').click();
cy.get('[data-test=ModalOnboarding]').should('not.exist');
cy.get('[data-test=ModalOnboardingTOS]').should('be.visible');
});

it('user is not able to click through entire onboarding flow', () => {
cy.window().then(win => {
const isDecisionWindowOpen = win.clientReactQuery.getQueryData(
QUERY_KEYS.isDecisionWindowOpen,
);

const onboardingSteps = isDecisionWindowOpen
? getStepsDecisionWindowOpen('2', '16 Jan')
: getStepsDecisionWindowClosed('2', '16 Jan');

for (let i = 1; i < onboardingSteps.length; i++) {
checkProgressStepperSlimIsCurrentAndClickNext(i, i === 1);
}
});
});

it('user is not able to close the modal by clicking button in the top-right', () => {
cy.get('[data-test=ModalOnboarding]').should('be.visible');
cy.get('[data-test=ModalOnboarding__Button]').click({ force: true });
cy.get('[data-test=ModalOnboarding]').should('be.visible');
});

it('renders every time page is refreshed', () => {
cy.get('[data-test=ModalOnboarding]').should('be.visible');
cy.reload();
cy.get('[data-test=ModalOnboarding]').should('be.visible');
});

it('user cannot change steps with arrow keys (left, right)', () => {
checkChangeStepsWithArrowKeys(false);
});

it('user cannot change steps by clicking the edge of the screen (up to 25px from each edge)', () => {
checkChangeStepsByClickingEdgeOfTheScreenUpTo25px(false, isMobile);
});

it('user cannot change steps by clicking the edge of the screen (more than 25px from each edge)', () => {
checkChangeStepsByClickingEdgeOfTheScreenMoreThan25px(false, isMobile);
});

it('user cannot change steps by swiping on screen (difference more than or equal 5px)', () => {
checkChangeStepsBySwipingOnScreenDifferenceMoreThanOrEqual5px(false);
});
}
},
);
});

it('user cannot change steps by swiping on screen (difference less than 5px)', () => {
checkChangeStepsBySwipingOnScreenDifferenceLessThanl5px(false);
});

if (index === arr.length - 1) {
it('TOS acceptance changes onboarding step to next step and allows the user to close the modal by clicking button in the top-right', () => {
checkCurrentElement(0, true);
cy.get('[data-test=TOS_InputCheckbox]').check();
cy.switchToMetamaskNotification();
cy.confirmMetamaskSignatureRequest();
checkCurrentElement(1, true);
cy.get('[data-test=ModalOnboarding__Button]').click();
cy.get('[data-test=ModalOnboarding]').should('not.exist');
});
}
},
);
},
);
10 changes: 4 additions & 6 deletions client/cypress/e2e/_08onboardingTOSAccepted.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
chai.use(chaiColors);

Object.values(viewports).forEach(
({ device, viewportWidth, viewportHeight, isDesktop, isLargeDesktop }) => {
({ device, viewportWidth, viewportHeight, isMobile, isDesktop, isLargeDesktop }) => {
describe(
`[AW IS CLOSED] onboarding (TOS accepted): ${device}`,
{ viewportHeight, viewportWidth },
Expand Down Expand Up @@ -103,16 +103,14 @@ Object.values(viewports).forEach(
checkChangeStepsWithArrowKeys(true);
});

// TODO will be unskipped in https://github.com/golemfoundation/octant/pull/624.
// eslint-disable-next-line
it.skip('user can change steps by clicking the edge of the screen (up to 25px from each edge)', () => {
checkChangeStepsByClickingEdgeOfTheScreenUpTo25px(true);
it('user can change steps by clicking the edge of the screen (up to 25px from each edge)', () => {
checkChangeStepsByClickingEdgeOfTheScreenUpTo25px(true, isMobile);
});

// TODO will be unskipped in https://github.com/golemfoundation/octant/pull/624.
// eslint-disable-next-line
it('user cannot change steps by clicking the edge of the screen (more than 25px from each edge)', () => {
checkChangeStepsByClickingEdgeOfTheScreenMoreThan25px(true);
checkChangeStepsByClickingEdgeOfTheScreenMoreThan25px(true, isMobile);
});

it('user can change steps by swiping on screen (difference more than or equal 5px)', () => {
Expand Down
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
18 changes: 13 additions & 5 deletions client/cypress/utils/onboarding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,14 @@ export const checkChangeStepsWithArrowKeys = (isTOSAccepted: boolean): void => {
});
};

export const checkChangeStepsByClickingEdgeOfTheScreenUpTo25px = (isTOSAccepted: boolean): void => {
export const checkChangeStepsByClickingEdgeOfTheScreenUpTo25px = (
isTOSAccepted: boolean,
isMobile = false,
): void => {
checkCurrentElement(0, true);

cy.get('[data-test=ModalOnboarding]').then(element => {
const leftEdgeX = element.offsetParent().offset()?.left as number;
const leftEdgeX = element.offsetParent()?.offset()?.left || 0;
const rightEdgeX = (leftEdgeX as number) + element.innerWidth()!;

[
Expand All @@ -89,7 +92,9 @@ export const checkChangeStepsByClickingEdgeOfTheScreenUpTo25px = (isTOSAccepted:
{ clientX: leftEdgeX + 5, el: 0 },
{ clientX: leftEdgeX, el: 0 },
].forEach(({ clientX, el }) => {
cy.get('[data-test=ModalOnboarding]').click(clientX, element.height()! / 2);
cy.get('[data-test=ModalOnboarding]').click(clientX, element.height()! / 2, {
force: isMobile,
});
checkCurrentElement(el, isTOSAccepted || el === 0);

if (!isTOSAccepted) {
Expand All @@ -101,11 +106,12 @@ export const checkChangeStepsByClickingEdgeOfTheScreenUpTo25px = (isTOSAccepted:

export const checkChangeStepsByClickingEdgeOfTheScreenMoreThan25px = (
isTOSAccepted: boolean,
isMobile = false,
): void => {
checkCurrentElement(0, true);

cy.get('[data-test=ModalOnboarding]').then(element => {
const leftEdgeX = element.offsetParent().offset()?.left as number;
const leftEdgeX = element.offsetParent()?.offset()?.left || 0;
const rightEdgeX = (leftEdgeX as number) + element.innerWidth()!;

[
Expand All @@ -114,7 +120,9 @@ export const checkChangeStepsByClickingEdgeOfTheScreenMoreThan25px = (
{ clientX: leftEdgeX + 26, el: 1 },
{ clientX: leftEdgeX + 25, el: 0 },
].forEach(({ clientX, el }) => {
cy.get('[data-test=ModalOnboarding]').click(clientX, element.height()! / 2);
cy.get('[data-test=ModalOnboarding]').click(clientX, element.height()! / 2, {
force: isMobile,
});
checkCurrentElement(el, isTOSAccepted || el === 0);

if (!isTOSAccepted) {
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
Loading

0 comments on commit 05f9b42

Please sign in to comment.