Skip to content

Commit 88477b8

Browse files
authored
fix: tests removing ROCOCO contracts (#570)
1 parent f9bb777 commit 88477b8

File tree

10 files changed

+4366
-4192
lines changed

10 files changed

+4366
-4192
lines changed

.yarn/releases/yarn-3.1.1.cjs

Lines changed: 0 additions & 768 deletions
This file was deleted.

.yarn/releases/yarn-4.6.0.cjs

Lines changed: 934 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1+
compressionLevel: mixed
2+
3+
enableGlobalCache: false
4+
15
nodeLinker: node-modules
2-
yarnPath: .yarn/releases/yarn-3.1.1.cjs
6+
7+
yarnPath: .yarn/releases/yarn-4.6.0.cjs

cypress.config.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,21 @@
22
// SPDX-License-Identifier: GPL-3.0-only
33

44
import { defineConfig } from 'cypress';
5-
import task from '@cypress/code-coverage/task';
65

76
export default defineConfig({
87
projectId: 'eup7bh',
98
e2e: {
109
specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}',
1110
baseUrl: 'http://127.0.0.1:8081/',
1211
testIsolation: false,
13-
setupNodeEvents(on, config) {
14-
task(on, config);
12+
async setupNodeEvents(on, config) {
13+
try {
14+
const task = await import('@cypress/code-coverage/task');
15+
task.default(on, config);
16+
} catch (err) {
17+
console.warn('[WARN] Code coverage task not loaded:', err?.message ?? err);
18+
}
19+
1520
return config;
1621
},
1722
},

cypress/e2e/extension.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ interface Window {
77

88
describe('Signer extension flow on live networks', () => {
99
before(() => {
10-
cy.visit(`/instantiate/?rpc=wss://rococo-contracts-rpc.polkadot.io`);
10+
cy.visit(`/instantiate/?rpc=wss://rpc2.paseo.popnetwork.xyz`);
1111
});
1212

1313
it('connects to Rococo', () => {
14-
cy.contains('Connecting to wss://rococo-contracts-rpc.polkadot.io').should('not.exist', {
14+
cy.contains('Connecting to wss://rpc2.paseo.popnetwork.xyz').should('not.exist', {
1515
timeout: 25000,
1616
});
1717
});
1818

1919
it('Rococo is selected in the network connection dropdown', () => {
2020
cy.get('.dropdown.chain')
2121
.find('.dropdown__single-value')
22-
.should('contain', 'Contracts (Rococo)');
22+
.should('contain', 'Pop Network Testnet');
2323
});
2424

2525
it('Displays help text for no extension installed', () => {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"yup": "^1.4.0"
5959
},
6060
"devDependencies": {
61-
"@cypress/code-coverage": "^3.12.20",
61+
"@cypress/code-coverage": "^3.14.4",
6262
"@cypress/snapshot": "^2.1.7",
6363
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
6464
"@istanbuljs/nyc-config-typescript": "^1.0.2",
@@ -109,5 +109,5 @@
109109
"minimist": "npm:minimist@^1.2.6",
110110
"node-forge": "npm:node-forge@^1.3.0"
111111
},
112-
"packageManager": "yarn@3.1.1"
112+
"packageManager": "yarn@4.6.0"
113113
}

src/constants/index.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ export const LOCAL_STORAGE_KEY = {
1212

1313
export type LocalStorageKey = (typeof LOCAL_STORAGE_KEY)[keyof typeof LOCAL_STORAGE_KEY];
1414

15-
export const ROCOCO_CONTRACTS = {
16-
relay: 'Rococo',
17-
name: 'Contracts (Rococo)',
18-
rpc: 'wss://rococo-contracts-rpc.polkadot.io',
19-
};
20-
2115
const CUSTOM_ENDPOINT = localStorage.getItem(LOCAL_STORAGE_KEY.CUSTOM_ENDPOINT);
2216
export const LOCAL = {
2317
relay: undefined,
@@ -32,7 +26,7 @@ export const LOCAL = {
3226
// rpc: 'wss://wss.agung.peaq.network',
3327
// };
3428

35-
const POP_NETWORK_TESTNET = {
29+
export const POP_NETWORK_TESTNET = {
3630
relay: 'Paseo',
3731
name: 'Pop Network Testnet',
3832
rpc: 'wss://rpc2.paseo.popnetwork.xyz',
@@ -104,7 +98,6 @@ const ZEITGEIST_BATTERY_STATION = {
10498

10599
export const TESTNETS = [
106100
...[
107-
ROCOCO_CONTRACTS,
108101
// PEAQ_AGUNG,
109102
PHALA_TESTNET,
110103
ASTAR_SHIBUYA,

src/ui/components/common/ConnectionError.tsx

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
// Copyright 2022-2024 use-ink/contracts-ui authors & contributors
22
// SPDX-License-Identifier: GPL-3.0-only
33

4-
import { useNavigate } from 'react-router-dom';
54
import { Error } from './Error';
65
import { useApi } from 'ui/contexts';
7-
import { ROCOCO_CONTRACTS, LOCAL } from 'src/constants';
6+
import { LOCAL } from 'src/constants';
87

98
function ContractsNodeHelp() {
10-
const navigate = useNavigate();
119
return (
1210
<>
1311
<div className="flex flex-col items-center">
@@ -27,18 +25,6 @@ function ContractsNodeHelp() {
2725
substrate-contracts-node --dev
2826
</div>
2927
</div>
30-
<div>
31-
Alternatively, connect to{' '}
32-
<a
33-
className="whitespace-nowrap"
34-
href="#"
35-
onClick={() => {
36-
navigate(`/?rpc=${ROCOCO_CONTRACTS.rpc}`);
37-
}}
38-
>
39-
Contracts parachain on Rococo.
40-
</a>
41-
</div>
4228
</>
4329
);
4430
}

src/ui/contexts/ApiContext.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { useSearchParams } from 'react-router-dom';
66
import { web3Accounts, web3Enable, web3EnablePromise } from '@polkadot/extension-dapp';
77
import { WsProvider } from '@polkadot/api';
88
import { keyring } from '@polkadot/ui-keyring';
9-
import { LOCAL_STORAGE_KEY, ROCOCO_CONTRACTS } from '../../constants';
9+
import { LOCAL_STORAGE_KEY, POP_NETWORK_TESTNET } from '../../constants';
1010
import { ApiPromise, ApiState, ChainProperties, Account, Status, WeightV2 } from 'types';
1111
import { isValidWsUrl, isKeyringLoaded } from 'lib/util';
1212
import { useLocalStorage } from 'ui/hooks/useLocalStorage';
@@ -30,7 +30,7 @@ export const ApiContextProvider = ({ children }: React.PropsWithChildren<Partial
3030
const rpcUrl = searchParams.get('rpc');
3131
const [preferredEndpoint, setPreferredEndpoint] = useLocalStorage<string>(
3232
LOCAL_STORAGE_KEY.PREFERRED_ENDPOINT,
33-
ROCOCO_CONTRACTS.rpc,
33+
POP_NETWORK_TESTNET.rpc,
3434
);
3535
const [api, setApi] = useState({} as ApiPromise);
3636
const [endpoint, setEndpoint] = useState(preferredEndpoint);

0 commit comments

Comments
 (0)