Skip to content

Commit

Permalink
Merge branch 'develop' into LF-11128-jumper-create-how-to-swap-on-x-s…
Browse files Browse the repository at this point in the history
…eo-cluster-pages
  • Loading branch information
dennyscode committed Dec 11, 2024
2 parents ce99aaf + 49cc7b6 commit 575952d
Show file tree
Hide file tree
Showing 9 changed files with 1,406 additions and 2,070 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"@emotion/styled": "^11.13.0",
"@fingerprintjs/fingerprintjs": "^3.4.2",
"@headlessui/react": "^2.2.0",
"@lifi/explorer": "^0.0.3",
"@lifi/explorer": "^0.0.4",
"@lifi/sdk": "^3.4.1",
"@lifi/wallet-management": "^3.4.4",
"@lifi/widget": "^3.12.1",
"@lifi/wallet-management": "^3.4.5",
"@lifi/widget": "^3.12.2",
"@metaplex-foundation/mpl-core": "^1.1.1",
"@metaplex-foundation/umi": "^0.9.2",
"@metaplex-foundation/umi-bundle-defaults": "^0.9.2",
Expand Down
7 changes: 4 additions & 3 deletions src/components/Menu/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ import { ButtonSecondary } from '@/components/Button/Button.style';
import type { MenuKeysEnum } from '@/const/menuKeys';
import type { Breakpoint, SxProps, Theme } from '@mui/material';
import { Typography, useTheme } from '@mui/material';
import type { MouseEventHandler } from 'react';
import type { MouseEvent, MouseEventHandler, ReactNode } from 'react';
import { MenuItemContainer, MenuItemLink } from '.';
import { MenuItemLabel } from './MenuItemLabel';

export interface MenuItemLinkType {
url: string;
external?: boolean;
}

interface MenuItemProps {
open: boolean;
showButton: boolean | undefined;
children?: Element | JSX.Element | undefined;
children?: ReactNode; // Update the type here
disableRipple?: boolean | undefined;
autoFocus?: boolean;
showMoreIcon?: boolean;
Expand Down Expand Up @@ -49,7 +50,7 @@ export const MenuItem = ({
showButton={showButton || false}
sx={styles}
autoFocus={autoFocus}
onClick={(event) => {
onClick={(event: MouseEvent<HTMLLIElement>) => {
event.stopPropagation();
if (!children) {
onClick && onClick(event);
Expand Down
10 changes: 7 additions & 3 deletions synpressCache.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import { spawn } from 'child_process';

async function buildSynpressCache() {
console.log('Building Synpress cache...');
// console.log('Building Synpress cache...');

return new Promise<void>((resolve, reject) => {
const process = spawn('yarn', ['build:cache', '--force', 'tests/wallet-setup/'], { stdio: 'inherit' });
const process = spawn(
'yarn',
['build:cache', '--force', 'tests/wallet-setup/'],
{ stdio: 'inherit' },
);

process.on('close', (code) => {
if (code === 0) {
console.log('Synpress cache build complete.');
// console.log('Synpress cache build complete.');
resolve();
} else {
console.error(`Failed to build Synpress cache with exit code ${code}`);
Expand Down
18 changes: 14 additions & 4 deletions tests/connectWallet.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { execSync } from 'child_process';
import { testWithSynpress } from '@synthetixio/synpress-core';
import { MetaMask, metaMaskFixtures } from '@synthetixio/synpress';
import { openOrCloseMainMenu, itemInMenu, closeWelcomeScreen } from './testData/commonFunctions';
import {
openOrCloseMainMenu,
itemInMenu,
closeWelcomeScreen,
} from './testData/commonFunctions';
import basicSetup from './wallet-setup/basic.setup';

const test = testWithSynpress(metaMaskFixtures(basicSetup));
Expand All @@ -20,9 +24,15 @@ test.describe('Connect Metamask with Jumper app and open /profile page', () => {
extensionId,
);
const connectWalletButton = page.locator('#connect-wallet-button');
const metaMaskWalletOption = page.locator('xpath=//span[normalize-space(text())="MetaMask"]');
const availableMissionTitle = page.locator('xpath=//p[normalize-space(text())="Available Missions"]');
const ethereumOption = page.locator('xpath=//span[normalize-space(text())="Ethereum"]');
const metaMaskWalletOption = page.locator(
'xpath=//span[normalize-space(text())="MetaMask"]',
);
const availableMissionTitle = page.locator(
'xpath=//p[normalize-space(text())="Available Missions"]',
);
const ethereumOption = page.locator(
'xpath=//span[normalize-space(text())="Ethereum"]',
);
await page.goto('/');
await expect(connectWalletButton).toBeEnabled();
await connectWalletButton.click();
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect, test } from '@playwright/test';
import values from '../tests/testData/values.json' assert { type:"json"};
import values from '../tests/testData/values.json' assert { type: 'json' };
import {
closeWelcomeScreen,
expectBackgroundColorToHaveCss,
Expand Down
4 changes: 2 additions & 2 deletions tests/swapActions.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test } from '@playwright/test';
import chainData from './testData/chainData.json' assert {type:"json"};
import chainData from './testData/chainData.json' assert { type: 'json' };
import {
buildUlParams,
checkIfBestReturnLabelIsVisible,
Expand Down Expand Up @@ -34,7 +34,7 @@ test.describe('On chain swaps', () => {
await page.goto(`/${urlParams}`);
await checkIfBestReturnLabelIsVisible(page);
});

test(`Check ${chainData.ARBtoARB.ETHtoUSDT.tokenSymbol} to ${chainData.ARBtoARB.ETHtoUSDT.toTokenSymbol} swap pair on ARB chain`, async ({
page,
}) => {
Expand Down
2 changes: 1 addition & 1 deletion tests/wallet-setup/basic.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default defineWalletSetup(PASSWORD, async (context, walletPage) => {
const metamask = new MetaMask(context, walletPage, PASSWORD);

await metamask.importWallet(SEED_PHRASE);
});
});
6 changes: 3 additions & 3 deletions tests/wallet-setup/synpress.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { testWithSynpress, metaMaskFixtures } from '@synthetixio/synpress'
import { testWithSynpress, metaMaskFixtures } from '@synthetixio/synpress';

import connectedSetup from '../wallet-setup/connected.setup'
import connectedSetup from '../wallet-setup/connected.setup';

export default testWithSynpress(metaMaskFixtures(connectedSetup))
export default testWithSynpress(metaMaskFixtures(connectedSetup));
Loading

0 comments on commit 575952d

Please sign in to comment.