Skip to content

Commit

Permalink
oct-2144: calendar alert test 8
Browse files Browse the repository at this point in the history
  • Loading branch information
jmikolajczyk committed Nov 26, 2024
1 parent bd860f7 commit abdc761
Show file tree
Hide file tree
Showing 2 changed files with 217 additions and 217 deletions.
130 changes: 65 additions & 65 deletions client/cypress/e2e/_8connectWallet.cy.ts
Original file line number Diff line number Diff line change
@@ -1,76 +1,76 @@
// // eslint-disable-next-line import/no-extraneous-dependencies
// import chaiColors from 'chai-colors';
// eslint-disable-next-line import/no-extraneous-dependencies
import chaiColors from 'chai-colors';

// import { connectWallet, visitWithLoader } from 'cypress/utils/e2e';
// import { beforeSetup } from 'cypress/utils/onboarding';
// import viewports from 'cypress/utils/viewports';
// import {
// HAS_ONBOARDING_BEEN_CLOSED,
// IS_ONBOARDING_ALWAYS_VISIBLE,
// IS_ONBOARDING_DONE,
// } from 'src/constants/localStorageKeys';
// import { ROOT, ROOT_ROUTES } from 'src/routes/RootRoutes/routes';
import { connectWallet, visitWithLoader } from 'cypress/utils/e2e';
import { beforeSetup } from 'cypress/utils/onboarding';
import viewports from 'cypress/utils/viewports';
import {
HAS_ONBOARDING_BEEN_CLOSED,
IS_ONBOARDING_ALWAYS_VISIBLE,
IS_ONBOARDING_DONE,
} from 'src/constants/localStorageKeys';
import { ROOT, ROOT_ROUTES } from 'src/routes/RootRoutes/routes';

// chai.use(chaiColors);
chai.use(chaiColors);

// Object.values(viewports).forEach(({ device, viewportWidth, viewportHeight }) => {
// describe(`[AW IS CLOSED] Connect wallet: ${device}`, { viewportHeight, viewportWidth }, () => {
// before(() => {
// beforeSetup();
// cy.clearLocalStorage();
// });
Object.values(viewports).forEach(({ device, viewportWidth, viewportHeight }) => {
describe(`[AW IS CLOSED] Connect wallet: ${device}`, { viewportHeight, viewportWidth }, () => {
before(() => {
beforeSetup();
cy.clearLocalStorage();
});

// beforeEach(() => {
// localStorage.setItem(IS_ONBOARDING_ALWAYS_VISIBLE, 'false');
// localStorage.setItem(IS_ONBOARDING_DONE, 'true');
// localStorage.setItem(HAS_ONBOARDING_BEEN_CLOSED, 'true');
// visitWithLoader(ROOT.absolute, ROOT_ROUTES.home.absolute);
// });
beforeEach(() => {
localStorage.setItem(IS_ONBOARDING_ALWAYS_VISIBLE, 'false');
localStorage.setItem(IS_ONBOARDING_DONE, 'true');
localStorage.setItem(HAS_ONBOARDING_BEEN_CLOSED, 'true');
visitWithLoader(ROOT.absolute, ROOT_ROUTES.home.absolute);
});

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

// it('Connect wallet button opens Connect wallet Modal', () => {
// cy.get('[data-test=LayoutTopBar__Button]').click();
// cy.wait(500);
// cy.get('[data-test=ModalLayoutConnectWallet]').should('be.visible');
// });
it('Connect wallet button opens Connect wallet Modal', () => {
cy.get('[data-test=LayoutTopBar__Button]').click();
cy.wait(500);
cy.get('[data-test=ModalLayoutConnectWallet]').should('be.visible');
});

// it('Close button in top-right corner is visible and closes Connect wallet Modal when clicked', () => {
// cy.get('[data-test=LayoutTopBar__Button]').click();
// cy.wait(500);
// cy.get('[data-test=ModalLayoutConnectWallet__Button]').should('be.visible');
// cy.get('[data-test=ModalLayoutConnectWallet__Button]').click();
// cy.wait(500);
// cy.get('[data-test=ModalLayoutConnectWallet]').should('not.exist');
// });
it('Close button in top-right corner is visible and closes Connect wallet Modal when clicked', () => {
cy.get('[data-test=LayoutTopBar__Button]').click();
cy.wait(500);
cy.get('[data-test=ModalLayoutConnectWallet__Button]').should('be.visible');
cy.get('[data-test=ModalLayoutConnectWallet__Button]').click();
cy.wait(500);
cy.get('[data-test=ModalLayoutConnectWallet]').should('not.exist');
});

// it('Connect wallet Modal has overflow which closes Connect wallet Modal when clicked', () => {
// cy.get('[data-test=LayoutTopBar__Button]').click();
// cy.wait(500);
// cy.get('[data-test=ModalLayoutConnectWallet__overflow]').should('exist');
// cy.get('[data-test=ModalLayoutConnectWallet__overflow]').click({ force: true });
// cy.wait(500);
// cy.get('[data-test=ModalLayoutConnectWallet]').should('not.exist');
// });
it('Connect wallet Modal has overflow which closes Connect wallet Modal when clicked', () => {
cy.get('[data-test=LayoutTopBar__Button]').click();
cy.wait(500);
cy.get('[data-test=ModalLayoutConnectWallet__overflow]').should('exist');
cy.get('[data-test=ModalLayoutConnectWallet__overflow]').click({ force: true });
cy.wait(500);
cy.get('[data-test=ModalLayoutConnectWallet]').should('not.exist');
});

// it('Connect wallet Modal shows "WalletConnect" and "Browser wallet" options when wallet with "injected" id is detected.', () => {
// cy.get('[data-test=LayoutTopBar__Button]').click();
// cy.wait(500);
// cy.get('[data-test=ConnectWallet__BoxRounded--browserWallet]').should('be.visible');
// cy.get('[data-test=ConnectWallet__BoxRounded--walletConnect]').should('be.visible');
// });
it('Connect wallet Modal shows "WalletConnect" and "Browser wallet" options when wallet with "injected" id is detected.', () => {
cy.get('[data-test=LayoutTopBar__Button]').click();
cy.wait(500);
cy.get('[data-test=ConnectWallet__BoxRounded--browserWallet]').should('be.visible');
cy.get('[data-test=ConnectWallet__BoxRounded--walletConnect]').should('be.visible');
});

// it('Clicking on "WalletConnect" option, opens WalletConnect modal', () => {
// cy.get('[data-test=LayoutTopBar__Button]').click();
// cy.wait(500);
// cy.get('[data-test=ConnectWallet__BoxRounded--walletConnect]').click();
// });
it('Clicking on "WalletConnect" option, opens WalletConnect modal', () => {
cy.get('[data-test=LayoutTopBar__Button]').click();
cy.wait(500);
cy.get('[data-test=ConnectWallet__BoxRounded--walletConnect]').click();
});

// it('Clicking on "Browser wallet" option connects with MetaMask wallet', () => {
// connectWallet({ isPatronModeEnabled: false });
// cy.get('[data-test=LayoutTopBar__Button]').should('contain.text', '0x');
// });
// });
// });
it('Clicking on "Browser wallet" option connects with MetaMask wallet', () => {
connectWallet({ isPatronModeEnabled: false });
cy.get('[data-test=LayoutTopBar__Button]').should('contain.text', '0x');
});
});
});
Loading

0 comments on commit abdc761

Please sign in to comment.