Skip to content

Commit

Permalink
refactor: remove legacy integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranjamie committed Sep 29, 2023
1 parent 41ec75c commit 6c507c2
Show file tree
Hide file tree
Showing 52 changed files with 139 additions and 2,304 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ jobs:
- name: Build prod
run: yarn build

- name: Run jest
run: yarn test:unit --coverage

- name: Make badge maker
run: npx make-coverage-badge

Expand Down
85 changes: 0 additions & 85 deletions .github/workflows/integration-tests.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ web-ext-artifacts/
.yalc/
yalc.lock
coverage
.jest-cache
release_body.md
trace*
/test-results/
Expand Down
10 changes: 0 additions & 10 deletions global-playwright-setup.js

This file was deleted.

48 changes: 0 additions & 48 deletions jest.config.js

This file was deleted.

52 changes: 0 additions & 52 deletions jest.integration.config.js

This file was deleted.

39 changes: 13 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,15 @@
"lint:eslint": "eslint \"src/**/*.{ts,tsx}\"",
"lint:filename": "ls-lint",
"lint:fix": "eslint \"src/**/*.{ts,tsx}\" --fix",
"lint:prettier": "prettier --check \"{src,tests,tests-legacy}/**/*.{ts,tsx}\" \"*.{js,json}\"",
"lint:prettier:fix": "prettier --write \"{src,tests,tests-legacy}/**/*.{ts,tsx}\" *.js",
"lint:prettier": "prettier --check \"{src,tests}/**/*.{ts,tsx}\" \"*.{js,json}\"",
"lint:prettier:fix": "prettier --write \"{src,tests}/**/*.{ts,tsx}\" *.js",
"lint:unused-exports": "ts-unused-exports tsconfig.json --ignoreFiles=leather-styles",
"lint:remote-wallet-config": "npx ajv-cli validate -s config/wallet-config.schema.json -d config/wallet-config.json",
"lint:deps": "dependency-cruise --config .dependency-cruiser.js \"src/**/*.{ts,tsx}\"",
"prod:ext": "yarn build",
"prod:analyze": "cross-env WALLET_ENVIRONMENT=production ANALYZE=true webpack -p",
"test:integration": "jest --config=./jest.integration.config.js --verbose=true --runInBand --testPathPattern=./tests-legacy/integration/*",
"test:integration:ci": "jest --config=./jest.integration.config.js --testPathPattern=./tests-legacy/integration/*",
"test:integration-api": "jest --config=./jest.integration.config.js --verbose=true --runInBand --testPathPattern=./tests-legacy/test-api/*",
"test:integration-api:ci": "jest --config=./jest.integration.config.js --testPathPattern=./tests-legacy/test-api/*",
"test:integration": "playwright test",
"test:unit": "vitest run",
"test": "WALLET_ENVIRONMENT=testing jest --verbose=true",
"test:coverage": "WALLET_ENVIRONMENT=testing jest --collect-coverage",
"test:watch": "WALLET_ENVIRONMENT=testing jest --watch",
"typecheck": "tsc --noEmit",
Expand Down Expand Up @@ -146,22 +142,22 @@
"@segment/analytics-next": "1.56.0",
"@sentry/react": "7.72.0",
"@sentry/tracing": "7.72.0",
"@stacks/auth": "6.5.4",
"@stacks/auth": "6.9.0",
"@stacks/blockchain-api-client": "6.3.4",
"@stacks/common": "6.5.2",
"@stacks/connect": "7.2.1",
"@stacks/connect-ui": "6.0.0",
"@stacks/encryption": "6.5.4",
"@stacks/network": "6.5.4",
"@stacks/profile": "6.5.4",
"@stacks/common": "6.8.1",
"@stacks/connect": "7.4.0",
"@stacks/connect-ui": "6.1.1",
"@stacks/encryption": "6.9.0",
"@stacks/network": "6.8.1",
"@stacks/profile": "6.9.0",
"@stacks/rpc-client": "1.0.3",
"@stacks/storage": "6.5.4",
"@stacks/storage": "6.9.0",
"@stacks/transactions": "6.9.0",
"@stacks/ui": "7.10.0",
"@stacks/ui-core": "7.3.0",
"@stacks/ui-theme": "7.5.0",
"@stacks/ui-utils": "7.5.0",
"@stacks/wallet-sdk": "6.5.4",
"@stacks/wallet-sdk": "6.9.0",
"@stitches/react": "1.2.8",
"@styled-system/theme-get": "5.1.2",
"@tanstack/query-sync-storage-persister": "4.35.3",
Expand Down Expand Up @@ -250,11 +246,9 @@
"@redux-devtools/remote": "0.8.1",
"@schemastore/web-manifest": "0.0.6",
"@sentry/webpack-plugin": "2.4.0",
"@stacks/connect-react": "22.1.1",
"@stacks/connect-react": "22.2.0",
"@stacks/prettier-config": "0.0.10",
"@stacks/stacks-blockchain-api-types": "6.3.4",
"@swc-node/jest": "1.5.6",
"@swc/core": "1.3.32",
"@trivago/prettier-plugin-sort-imports": "4.2.0",
"@types/argon2-browser": "1.18.2",
"@types/chroma-js": "2.4.1",
Expand All @@ -263,8 +257,6 @@
"@types/download": "8.0.2",
"@types/expect-puppeteer": "5.0.3",
"@types/html-webpack-plugin": "3.2.7",
"@types/jest": "29.2.6",
"@types/jest-dev-server": "5.0.0",
"@types/jsdom": "21.1.1",
"@types/lodash.get": "4.4.7",
"@types/node": "20.7.1",
Expand Down Expand Up @@ -310,10 +302,6 @@
"file-loader": "6.2.0",
"generate-json-webpack-plugin": "2.0.0",
"html-webpack-plugin": "5.5.3",
"jest": "29.3.1",
"jest-chrome": "0.8.0",
"jest-circus": "29.3.1",
"jest-dev-server": "6.2.0",
"jsdom": "22.1.0",
"postcss": "8.4.30",
"postcss-loader": "7.3.3",
Expand All @@ -326,7 +314,6 @@
"speed-measure-webpack-plugin": "1.5.0",
"stream-browserify": "3.0.0",
"svg-url-loader": "8.0.0",
"ts-jest": "29.0.5",
"ts-node": "10.9.1",
"ts-unused-exports": "7.0.3",
"tsconfig-paths-webpack-plugin": "4.0.1",
Expand Down
6 changes: 2 additions & 4 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ import { defineConfig, devices } from '@playwright/test';
* See https://playwright.dev/docs/test-configuration
*/
export default defineConfig({
globalSetup: './global-playwright-setup.js',
globalSetup: './tests/global-playwright-setup.js',
testDir: './tests',
timeout: 30 * 1000,
expect: {
timeout: 5000,
},
expect: { timeout: 5000 },
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PostConditionMode } from '@stacks/transactions';
import { generateContractCallToken } from '@tests-legacy/utils/transation-test-utils';
import { generateContractCallToken } from '@tests/transation-test-utils';
import { decodeToken } from 'jsontokens';

import { generateUnsignedTransaction } from './generate-unsigned-txs';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { FiCheck, FiCopy } from 'react-icons/fi';

import { Box, Flex, color } from '@stacks/ui';
import { UserAreaSelectors } from '@tests-legacy/integration/user-area.selectors';

interface AssetItemCopyIconProps {
hasCopied: boolean;
Expand All @@ -13,7 +12,7 @@ export function AssetItemCopyIcon({ hasCopied }: AssetItemCopyIconProps) {
<Box
size="16px"
color={color('text-caption')}
data-testid={UserAreaSelectors.AccountCopyAddress}
data-testid="account-copy-address"
as={hasCopied ? FiCheck : FiCopy}
mt="2px"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/app/features/add-network/add-network.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useNavigate } from 'react-router-dom';

import { ChainID } from '@stacks/transactions';
import { Input, Stack } from '@stacks/ui';
import { NetworkSelectors } from '@tests-legacy/integration/network.selectors';
import { NetworkSelectors } from '@tests/selectors/network.selectors';
import { Formik } from 'formik';
import { token } from 'leather-styles/tokens';

Expand Down
4 changes: 2 additions & 2 deletions src/app/features/asset-list/asset-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Outlet } from 'react-router-dom';
import { useNavigate } from 'react-router-dom';

import { Box, Stack } from '@stacks/ui';
import { HomePageSelectorsLegacy } from '@tests-legacy/page-objects/home.selectors';
import { HomePageSelectors } from '@tests/selectors/home.selectors';

import { LEDGER_BITCOIN_ENABLED } from '@shared/environment';

Expand All @@ -27,7 +27,7 @@ export function AssetsList() {
const navigate = useNavigate();

return (
<Stack pb="extra-loose" spacing="loose" data-testid={HomePageSelectorsLegacy.BalancesList}>
<Stack pb="extra-loose" spacing="loose" data-testid={HomePageSelectors.BalancesList}>
{/* Temporary duplication during Ledger Bitcoin feature dev */}
{whenWallet({
software: (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export function BitcoinSendMaxButton({
>
<Box>
<LeatherButton
type="button"
data-testid={SendCryptoAssetSelectors.SendMaxBtn}
onClick={() => onSendMax()}
variant="link"
Expand Down
2 changes: 1 addition & 1 deletion src/app/query/bitcoin/ordinals/inscription.query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const inscriptionQueryOptions = {
/**
* @param path - inscription/:inscription_id
*/
export function fetchInscription() {
function fetchInscription() {
return async (id: string) => {
const res = await fetch(`${HIRO_INSCRIPTIONS_API_URL}/${id}`);
if (!res.ok) throw new Error('Error retrieving inscription metadata');
Expand Down
Loading

0 comments on commit 6c507c2

Please sign in to comment.