Skip to content

Commit

Permalink
style: more verbose variable value, comment w/ explanation added
Browse files Browse the repository at this point in the history
  • Loading branch information
aziolek committed Apr 12, 2024
1 parent 49fb4fa commit 551f254
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion client/cypress/e2e/allocationItemWindowClosed.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('allocation (allocation window closed)', () => {
setupAndMoveToPlayground();

cy.window().then(async win => {
moveTime(win, 'decisionWindowClosed').then(() => {
moveTime(win, 'nextEpochDecisionWindowClosed').then(() => {
cy.get('[data-test=PlaygroundView]').should('be.visible');
const isDecisionWindowOpenAfter = win.clientReactQuery.getQueryData(
QUERY_KEYS.isDecisionWindowOpen,
Expand Down
2 changes: 1 addition & 1 deletion client/cypress/e2e/allocationItemWindowOpen.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('allocation (allocation window open)', () => {
setupAndMoveToPlayground();

cy.window().then(async win => {
moveTime(win, 'decisionWindowOpen').then(() => {
moveTime(win, 'nextEpochDecisionWindowOpen').then(() => {
const isDecisionWindowOpenAfter = win.clientReactQuery.getQueryData(
QUERY_KEYS.isDecisionWindowOpen,
);
Expand Down
2 changes: 1 addition & 1 deletion client/cypress/e2e/earn.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ Object.values(viewports).forEach(({ device, viewportWidth, viewportHeight, isDes
}).should('not.exist');
cy.window().then(async win => {
cy.wrap(null).then(() => {
return moveTime(win, 'decisionWindowClosed').then(() => {
return moveTime(win, 'nextEpochDecisionWindowClosed').then(() => {
cy.get('[data-test=BoxGlmLock__Section--current__DoubleValue__primary]', {
timeout: 60000,
})
Expand Down
2 changes: 1 addition & 1 deletion client/cypress/e2e/projectsArchive.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Object.values(viewports).forEach(({ device, viewportWidth, viewportHeight }) =>
);

cy.wrap(null).then(() => {
return moveTime(win, 'decisionWindowClosed').then(() => {
return moveTime(win, 'nextEpochDecisionWindowClosed').then(() => {
const currentEpochAfter = Number(
win.clientReactQuery.getQueryData(QUERY_KEYS.currentEpoch),
);
Expand Down
8 changes: 6 additions & 2 deletions client/cypress/utils/moveTime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,13 @@ const moveToDecisionWindowClosed = (cypressWindow: Cypress.AUTWindow): Chainable
return waitForLoadersToDisappear();
};

/**
* General note: this util moves the time to the next epoch, window open or closed.
* In the future we will add ability to move to window closed without changing the epoch.
*/
export const moveTime = (
cypressWindow: Cypress.AUTWindow,
moveTo: 'decisionWindowClosed' | 'decisionWindowOpen',
moveTo: 'nextEpochDecisionWindowClosed' | 'nextEpochDecisionWindowOpen',
shouldMoveToPlayground = false,
): Chainable<any> => {
if (shouldMoveToPlayground) {
Expand All @@ -116,7 +120,7 @@ export const moveTime = (
cy.reload();
}

if (moveTo === 'decisionWindowOpen') {
if (moveTo === 'nextEpochDecisionWindowOpen') {
moveToDecisionWindowOpen(cypressWindow);
} else {
moveToDecisionWindowOpen(cypressWindow);
Expand Down

0 comments on commit 551f254

Please sign in to comment.