diff --git a/libs/features/cart/src/lib/EventPassList/EventPassList.stories.tsx b/libs/features/cart/src/lib/EventPassList/EventPassList.stories.tsx index 05430431b..d38790a76 100644 --- a/libs/features/cart/src/lib/EventPassList/EventPassList.stories.tsx +++ b/libs/features/cart/src/lib/EventPassList/EventPassList.stories.tsx @@ -54,13 +54,6 @@ export const Default: Story = { export const Opened: Story = { ...Default, play: async () => { - await userEvent.click( - await screen.findByRole('button', { - name: /Lorem ipsum/i, - }), - ); - await screen.findByText(/6 x/i); - await screen.findByText(/General Admission/i); await userEvent.click( await screen.findByRole('button', { name: /World cup/i, diff --git a/libs/features/unlock/shopify/src/lib/OffKeyInfo/OffKeyInfo.stories.tsx b/libs/features/unlock/shopify/src/lib/OffKeyInfo/OffKeyInfo.stories.tsx index 0fc599395..bd29ea35f 100644 --- a/libs/features/unlock/shopify/src/lib/OffKeyInfo/OffKeyInfo.stories.tsx +++ b/libs/features/unlock/shopify/src/lib/OffKeyInfo/OffKeyInfo.stories.tsx @@ -1,7 +1,8 @@ import { OffKeyState } from '@next/iframe'; import { StoryObj, type Meta } from '@storybook/react'; import React from 'react'; -import { OffKeyInfo, OffKeyInfoSkeleton } from './OffKeyInfo'; +import { OffKeyInfo } from './OffKeyInfo'; +import { OffKeyInfoSkeleton } from './OffKeyInfoSkeleton'; const meta = { component: OffKeyInfo, diff --git a/libs/test-utils/functions/.eslintrc.json b/libs/test-utils/functions/.eslintrc.json deleted file mode 100644 index 3456be9b9..000000000 --- a/libs/test-utils/functions/.eslintrc.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": ["../../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": {} - }, - { - "files": ["*.ts", "*.tsx"], - "rules": {} - }, - { - "files": ["*.js", "*.jsx"], - "rules": {} - } - ] -} diff --git a/libs/test-utils/functions/.swcrc b/libs/test-utils/functions/.swcrc deleted file mode 100644 index a1276087c..000000000 --- a/libs/test-utils/functions/.swcrc +++ /dev/null @@ -1,29 +0,0 @@ -{ - "jsc": { - "target": "es2022", - "parser": { - "syntax": "typescript", - "decorators": true, - "dynamicImport": true - }, - "transform": { - "decoratorMetadata": true, - "legacyDecorator": true - }, - "keepClassNames": true, - "externalHelpers": true, - "loose": true - }, - "module": { - "type": "nodenext" - }, - "sourceMaps": true, - "exclude": [ - "jest.config.ts", - ".*\\.spec.tsx?$", - ".*\\.test.tsx?$", - "./src/jest-setup.ts$", - "./**/jest-setup.ts$", - ".*.js$" - ] -} \ No newline at end of file diff --git a/libs/test-utils/functions/README.md b/libs/test-utils/functions/README.md deleted file mode 100644 index e31c46e91..000000000 --- a/libs/test-utils/functions/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# test-utils-functions - -This library was generated with [Nx](https://nx.dev). - -## Building - -Run `nx build test-utils-functions` to build the library. - -## Running unit tests - -Run `nx test test-utils-functions` to execute the unit tests via [Jest](https://jestjs.io). diff --git a/libs/test-utils/functions/jest.config.ts b/libs/test-utils/functions/jest.config.ts deleted file mode 100644 index 17df1381d..000000000 --- a/libs/test-utils/functions/jest.config.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* eslint-disable */ -export default { - displayName: 'test-utils-functions', - preset: '../../../jest.preset.js', - globals: {}, - transform: { - '^.+\\.[tj]s$': [ - 'ts-jest', - { - tsconfig: '/tsconfig.spec.json', - }, - ], - }, - moduleFileExtensions: ['ts', 'js', 'html'], - coverageDirectory: '../../../coverage/libs/test-utils/functions', -}; diff --git a/libs/test-utils/functions/package.json b/libs/test-utils/functions/package.json deleted file mode 100644 index 0f612f090..000000000 --- a/libs/test-utils/functions/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@test-utils/functions", - "version": "0.0.1", - "type": "nodenext" -} diff --git a/libs/test-utils/functions/project.json b/libs/test-utils/functions/project.json deleted file mode 100644 index a24bb6dc0..000000000 --- a/libs/test-utils/functions/project.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "test-utils-functions", - "$schema": "../../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "libs/test-utils/functions/src", - "projectType": "library", - "targets": { - "build": { - "executor": "@nx/js:tsc", - "outputs": ["{options.outputPath}"], - "options": { - "outputPath": "dist/libs/test-utils/functions", - "main": "libs/test-utils/functions/src/index.ts", - "tsConfig": "libs/test-utils/functions/tsconfig.lib.json", - "assets": ["libs/test-utils/functions/*.md"] - } - }, - "lint": { - "executor": "@nx/eslint:lint", - "outputs": ["{options.outputFile}"] - }, - "test": { - "executor": "@nx/jest:jest", - "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], - "options": { - "jestConfig": "libs/test-utils/functions/jest.config.ts" - } - } - }, - "tags": [] -} diff --git a/libs/test-utils/functions/src/index.ts b/libs/test-utils/functions/src/index.ts deleted file mode 100644 index a1ca51ffd..000000000 --- a/libs/test-utils/functions/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './lib/delay'; diff --git a/libs/test-utils/functions/src/lib/delay.ts b/libs/test-utils/functions/src/lib/delay.ts deleted file mode 100644 index 8f9524ea6..000000000 --- a/libs/test-utils/functions/src/lib/delay.ts +++ /dev/null @@ -1,8 +0,0 @@ -export function delay(ms: number) { - return new Promise((resolve) => setTimeout(resolve, ms)); -} - -export async function delayData(ms = 2000, data: any) { - await delay(ms); - return data; -} diff --git a/libs/test-utils/functions/tsconfig.json b/libs/test-utils/functions/tsconfig.json deleted file mode 100644 index 817c7862a..000000000 --- a/libs/test-utils/functions/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "module": "NodeNext", - "moduleResolution": "NodeNext", - "allowJs": true, - "forceConsistentCasingInFileNames": true, - "strict": true, - "noImplicitOverride": true, - "noPropertyAccessFromIndexSignature": false, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true - }, - "files": [], - "include": [], - "references": [ - { - "path": "./tsconfig.lib.json" - }, - { - "path": "./tsconfig.spec.json" - } - ] -} diff --git a/libs/test-utils/functions/tsconfig.lib.json b/libs/test-utils/functions/tsconfig.lib.json deleted file mode 100644 index c262ec67b..000000000 --- a/libs/test-utils/functions/tsconfig.lib.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "../../../dist/out-tsc", - "declaration": true, - "types": ["node"] - }, - "include": ["**/*.ts"], - "exclude": ["jest.config.ts", "**/*.spec.ts", "**/*.test.ts"] -} diff --git a/libs/test-utils/functions/tsconfig.spec.json b/libs/test-utils/functions/tsconfig.spec.json deleted file mode 100644 index 7ccb1c62e..000000000 --- a/libs/test-utils/functions/tsconfig.spec.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "../../../dist/out-tsc", - "module": "nodenext", - "types": ["jest", "node"] - }, - "include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] -} diff --git a/libs/ui/components/.babelrc b/libs/ui/components/.babelrc deleted file mode 100644 index 7aafc53b2..000000000 --- a/libs/ui/components/.babelrc +++ /dev/null @@ -1,18 +0,0 @@ -{ - "sourceType": "unambiguous", - "presets": [ - [ - "@babel/preset-env", - { - "targets": { - "chrome": 100, - "safari": 15, - "firefox": 91 - } - } - ], - "@babel/preset-typescript", - "@babel/preset-react" - ], - "plugins": [] -} \ No newline at end of file diff --git a/libs/ui/components/.storybook/main.ts b/libs/ui/components/.storybook/main.ts index 7ead3b545..9d9bef897 100644 --- a/libs/ui/components/.storybook/main.ts +++ b/libs/ui/components/.storybook/main.ts @@ -29,8 +29,19 @@ module.exports = { }, framework: { name: '@storybook/react-webpack5', - options: {}, + options: { + builder: { useSWC: true }, + }, }, + swc: (config, options) => ({ + jsc: { + transform: { + react: { + runtime: 'automatic', + }, + }, + }, + }), docs: { autodocs: true, }, diff --git a/libs/ui/components/src/lib/button/Button.stories.tsx b/libs/ui/components/src/lib/button/Button.stories.tsx index d2c7b994d..c3588c845 100644 --- a/libs/ui/components/src/lib/button/Button.stories.tsx +++ b/libs/ui/components/src/lib/button/Button.stories.tsx @@ -6,7 +6,6 @@ import { waitForElementToBeRemoved, within, } from '@storybook/test'; -import { delayData } from '@test-utils/functions'; import { Settings } from '@ui/icons'; import { sleep } from '@utils'; @@ -54,7 +53,7 @@ type Story = StoryObj; export const DefaultButton = { args: { children: 'Button with Click and Loading', - onClick: () => delayData(1000, null), + onClick: () => sleep(1000), }, play: async ({ canvasElement, controls }) => { const canvas = within(canvasElement); diff --git a/libs/ui/components/src/lib/button/examples.tsx b/libs/ui/components/src/lib/button/examples.tsx index f1721080c..8472cceac 100644 --- a/libs/ui/components/src/lib/button/examples.tsx +++ b/libs/ui/components/src/lib/button/examples.tsx @@ -4,7 +4,7 @@ import { buttonSizes, type ButtonProps, } from './Button'; -import { delayData } from '@test-utils/functions'; +import { sleep } from '@utils'; import { OutlineArrowRight } from '@ui/icons'; export const variantOptions = Object.keys(buttonVariants); @@ -65,7 +65,7 @@ export const AllbuttonVariantsLoadingComponent: React.FC< key={variant} size={size} variant={variant as keyof typeof buttonVariants} - onClick={() => delayData(3000, null)} + onClick={() => sleep(3000)} isLoading > {variant} Loading @@ -83,7 +83,7 @@ export const AllbuttonSizesLoadingComponent: React.FC< key={size} size={size as keyof typeof buttonSizes} variant={variant} - onClick={() => delayData(3000, null)} + onClick={() => sleep(3000)} isLoading > {size} Loading diff --git a/tsconfig.base.json b/tsconfig.base.json index 6d25b9a4a..1b5a24509 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -219,7 +219,6 @@ "@smart-wallet/admin": ["libs/smart-wallet/admin/src/index.ts"], "@test-utils/cache": ["libs/test-utils/cache/src/index.ts"], "@test-utils/db": ["libs/test-utils/db/src/index.ts"], - "@test-utils/functions": ["libs/test-utils/functions/src/index.ts"], "@test-utils/gql": ["libs/test-utils/gql/src/index.ts"], "@test-utils/hasura": ["libs/test-utils/hasura/src/index.ts"], "@test-utils/next-intl": ["libs/test-utils/next-intl/src/index.tsx"],