diff --git a/.circleci/config.yml b/.circleci/config.yml index 5eebbf026..b3a6a631b 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -41,16 +41,16 @@ jobs: - run: name: Test application command: | - TEST=$(circleci tests glob "__tests__/**/*.test.js" | circleci tests split --split-by=timings) + TEST=$(circleci tests glob "**/*.test.js" | circleci tests split --split-by=timings) docker exec openq-frontend yarn test:cicd $TEST echo $TEST - run: - command: mkdir ~/test-results && docker cp openq-frontend:/app/junit.xml ~/test-results/junit.xml + command: mkdir ~/junit docker cp openq-frontend:/app/junit.xml ~/junit/ when: always - store_test_results: - path: ~/test-results//junit.xml + path: ~/junit - store_artifacts: - path: ~/test-results//junit.xml + path: ~/junit pushHelm: machine: true diff --git a/.eslintrc.json b/.eslintrc.json index db2e94b2a..73d236f80 100755 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -35,6 +35,9 @@ "unused-imports", "prettier" ], + "globals": { + "vi": true + }, "rules": { "no-async-promise-executor": "off", "no-inner-declarations": "off", diff --git a/__tests__/pages/github.test.js b/__tests__/pages/github.test.jsx similarity index 66% rename from __tests__/pages/github.test.js rename to __tests__/pages/github.test.jsx index 87c64fd4e..aeb3e2df4 100755 --- a/__tests__/pages/github.test.js +++ b/__tests__/pages/github.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import GithubAuth from '../../pages/auth/github'; @@ -9,20 +9,20 @@ import nextRouter from 'next/router'; describe('GithubAuth', () => { beforeEach(() => { - const observe = jest.fn(); - const disconnect = jest.fn(); + const observe = vi.fn(); + const disconnect = vi.fn(); - window.IntersectionObserver = jest.fn(() => ({ + window.IntersectionObserver = vi.fn(() => ({ observe, disconnect, })); - nextRouter.useRouter = jest.fn(); + nextRouter.useRouter = vi.fn(); nextRouter.useRouter.mockImplementation(() => ({ query: { type: null }, - prefetch: jest.fn(() => { - return { catch: jest.fn }; + prefetch: vi.fn(() => { + return { catch: vi.fn }; }), })); }); diff --git a/components/Admin/Blacklisting/Blacklisting.test.js b/components/Admin/Blacklisting/Blacklisting.test.jsx similarity index 98% rename from components/Admin/Blacklisting/Blacklisting.test.js rename to components/Admin/Blacklisting/Blacklisting.test.jsx index 659b71e4a..e4d5ca951 100755 --- a/components/Admin/Blacklisting/Blacklisting.test.js +++ b/components/Admin/Blacklisting/Blacklisting.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import { render, screen } from '../../../test-utils'; diff --git a/components/Admin/Blacklisting/index.js b/components/Admin/Blacklisting/index.jsx similarity index 100% rename from components/Admin/Blacklisting/index.js rename to components/Admin/Blacklisting/index.jsx diff --git a/components/Admin/GrossValueMoved/GrossValueMoved.test.js b/components/Admin/GrossValueMoved/GrossValueMoved.test.jsx similarity index 96% rename from components/Admin/GrossValueMoved/GrossValueMoved.test.js rename to components/Admin/GrossValueMoved/GrossValueMoved.test.jsx index 740418dfb..7f5fc199e 100755 --- a/components/Admin/GrossValueMoved/GrossValueMoved.test.js +++ b/components/Admin/GrossValueMoved/GrossValueMoved.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import { render, screen } from '../../../test-utils'; diff --git a/components/Admin/GrossValueMoved/index.js b/components/Admin/GrossValueMoved/index.jsx similarity index 100% rename from components/Admin/GrossValueMoved/index.js rename to components/Admin/GrossValueMoved/index.jsx diff --git a/components/Admin/Users/Users.test.js b/components/Admin/Users/Users.test.jsx similarity index 97% rename from components/Admin/Users/Users.test.js rename to components/Admin/Users/Users.test.jsx index 16f72cffe..a8d552b39 100755 --- a/components/Admin/Users/Users.test.js +++ b/components/Admin/Users/Users.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import { render, screen } from '../../../test-utils'; diff --git a/components/Admin/Users/index.js b/components/Admin/Users/index.jsx similarity index 100% rename from components/Admin/Users/index.js rename to components/Admin/Users/index.jsx diff --git a/components/AdminPage/AdminModal/AdminModal.test.js b/components/AdminPage/AdminModal/AdminModal.test.jsx similarity index 99% rename from components/AdminPage/AdminModal/AdminModal.test.js rename to components/AdminPage/AdminModal/AdminModal.test.jsx index 4263ef24a..ad3e2df5d 100755 --- a/components/AdminPage/AdminModal/AdminModal.test.js +++ b/components/AdminPage/AdminModal/AdminModal.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import { render, screen } from '../../../test-utils'; diff --git a/components/AdminPage/AdminModal/index.js b/components/AdminPage/AdminModal/index.jsx similarity index 100% rename from components/AdminPage/AdminModal/index.js rename to components/AdminPage/AdminModal/index.jsx diff --git a/components/AdminPage/AdminPage.test.js b/components/AdminPage/AdminPage.test.jsx similarity index 98% rename from components/AdminPage/AdminPage.test.js rename to components/AdminPage/AdminPage.test.jsx index 884b0b655..22d1b4e09 100755 --- a/components/AdminPage/AdminPage.test.js +++ b/components/AdminPage/AdminPage.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import { render, screen } from '../../test-utils'; diff --git a/components/AdminPage/SetBudgetAdminPage/SetBudgetAdminPage.test.js b/components/AdminPage/SetBudgetAdminPage/SetBudgetAdminPage.test.js deleted file mode 100644 index bf107b6c9..000000000 --- a/components/AdminPage/SetBudgetAdminPage/SetBudgetAdminPage.test.js +++ /dev/null @@ -1,165 +0,0 @@ -/** - * @jest-environment jsdom - */ -import React from 'react'; -import { render, screen } from '../../../test-utils'; -import SetBudgetAdminPage from '.'; -import InitialState from '../../../store/Store/InitialState'; -import Constants from '../../../test-utils/constant'; -import userEvent from '@testing-library/user-event'; -import MockOpenQClient from '../../../services/ethers/MockOpenQClient'; - -describe('SetBudgetAdminPage', () => { - const bounty = Constants.bounty; - beforeEach(() => { - InitialState.openQClient.reset(); - const observe = jest.fn(); - const disconnect = jest.fn(); - window.IntersectionObserver = jest.fn(() => ({ - observe, - disconnect, - })); - }); - describe('Split Price Contracts', () => { - const splitBounty = Constants.bounty1; - it('should allow user to update budget token and volume when no deposits', async () => { - const noDepositSplitBounty = { ...splitBounty, deposits: [] }; - // ARRANGE - const user = userEvent.setup(); - const setFundingGoal = jest.fn(); - const customInitialState = { - ...InitialState, - openQClient: new MockOpenQClient({ setFundingGoal }), - }; - const { asFragment } = render( - {}} bounty={noDepositSplitBounty} />, - {}, - customInitialState - ); - expect(asFragment()).toMatchSnapshot('Snapshot: initial view'); - - // ACT - await user.type(screen.getByRole('textbox'), '100'); - await user.click(screen.getByRole('button', { name: 'select token' })); - await user.click(screen.getByRole('button', { name: /link/i })); - await user.click(await screen.findByRole('button', { name: 'Set New Budget' })); - - // ASSERT - expect(await screen.findByText(/Updating Budget.../)).toBeInTheDocument(); - expect(screen.getByText(/our request is being processed.../)).toBeInTheDocument(); - const updatedTexts = await screen.findAllByText(/updated/i); - expect(updatedTexts[0]).toBeInTheDocument(); - expect(await screen.findByText(/budget set to/i)).toBeInTheDocument(); - expect(await screen.findByText(/100.0 LINK/)).toBeInTheDocument(); - expect(setFundingGoal).toBeCalledWith( - noDepositSplitBounty.bountyId, - '100', - '0x5FbDB2315678afecb367f032d93F642f64180aa3' - ); - }); - it('should set payout token per default if payoutTokenVolume BUT allow user to update payout token and volume if no deposits', async () => { - // payout token to DERC20, so showing that as default, but allowing change to Link since there are no deposits. - // ARRANGE - const noDepositButPayoutSplitBounty = { - ...splitBounty, - deposits: [], - payoutTokenAddress: '0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0', - }; - const user = userEvent.setup(); - const setFundingGoal = jest.fn(); - const customInitialState = { - ...InitialState, - openQClient: new MockOpenQClient({ setFundingGoal }), - }; - const { asFragment } = render( - {}} bounty={noDepositButPayoutSplitBounty} />, - {}, - customInitialState - ); - expect(asFragment()).toMatchSnapshot('Snapshot: initial view'); - - // ACT - await user.type(screen.getByRole('textbox'), '100'); - const matic = screen.queryByText(/matic/i); - expect(matic).not.toBeInTheDocument(); - const tokenButton = screen.getByRole('button', { name: 'select token' }); - await user.click(tokenButton); - await user.click(screen.getByRole('button', { name: /link/i })); - await user.click(await screen.findByRole('button', { name: 'Set New Budget' })); - - // ASSERT - expect(await screen.findByText(/Updating Budget.../)).toBeInTheDocument(); - expect(screen.getByText(/our request is being processed.../)).toBeInTheDocument(); - const updatedTexts = await screen.findAllByText(/updated/i); - expect(updatedTexts[0]).toBeInTheDocument(); - expect(await screen.findByText(/100.0 LINK/i)).toBeInTheDocument(); - expect(setFundingGoal).toBeCalledWith( - noDepositButPayoutSplitBounty.bountyId, - '100', - '0x5FbDB2315678afecb367f032d93F642f64180aa3' - ); - }); - it('should lock token but allow volume update when deposits', async () => { - // ARRANGE - const otherTokenDepositSplitBounty = { ...splitBounty, deposits: [Constants.deposit2] }; - const user = userEvent.setup(); - const setFundingGoal = jest.fn(); - const customInitialState = { - ...InitialState, - openQClient: new MockOpenQClient({ setFundingGoal }), - }; - render( - {}} bounty={otherTokenDepositSplitBounty} />, - {}, - customInitialState - ); - - // ACT - await user.type(screen.getByRole('textbox'), '100'); - const selectToken = screen.getByRole('button', { name: 'select token' }); - expect(selectToken).toBeDisabled(true); - expect(selectToken).toMatchSnapshot('Snapshot: button style changes to not appear as button'); - await user.click(await screen.findByRole('button', { name: 'Set New Budget' })); - - // ASSERT - expect(await screen.findByText(/Updating Budget.../)).toBeInTheDocument(); - expect(screen.getByText(/our request is being processed.../)).toBeInTheDocument(); - const updatedTexts = await screen.findAllByText(/updated/i); - expect(updatedTexts[0]).toBeInTheDocument(); - expect(await screen.findByText(/100.0 DERC20/i)).toBeInTheDocument(); - expect(setFundingGoal).toBeCalledWith( - otherTokenDepositSplitBounty.bountyId, - '100', - otherTokenDepositSplitBounty.deposits[0].tokenAddress - ); - }); - }); - describe('Fixed price contracts', () => { - it('should allow user to update budget', async () => { - // ARRANGE - const user = userEvent.setup(); - const setFundingGoal = jest.fn(); - const customInitialState = { - ...InitialState, - openQClient: new MockOpenQClient({ setFundingGoal }), - }; - render( {}} bounty={bounty} />, {}, customInitialState); - expect(screen.getByText('Set a New Budget for this Contract')).toBeInTheDocument(); - - // ACT - await user.type(screen.getByRole('textbox'), '100'); - await user.click(screen.getByRole('button', { name: 'select token' })); - await user.click(screen.getByRole('button', { name: /link/i })); - await user.click(await screen.findByRole('button', { name: 'Set New Budget' })); - - // ASSERT - expect(await screen.findByText(/Updating Budget.../)).toBeInTheDocument(); - expect(screen.getByText(/our request is being processed.../)).toBeInTheDocument(); - const updatedTexts = await screen.findAllByText(/updated/i); - expect(updatedTexts[0]).toBeInTheDocument(); - expect(await screen.findByText(/budget set to/i)).toBeInTheDocument(); - expect(await screen.findByText(/100.0 LINK/)).toBeInTheDocument(); - expect(setFundingGoal).toBeCalledWith(bounty.bountyId, '100', '0x5FbDB2315678afecb367f032d93F642f64180aa3'); - }); - }); -}); diff --git a/components/AdminPage/SetBudgetAdminPage/SetBudgetAdminPage.test.jsx b/components/AdminPage/SetBudgetAdminPage/SetBudgetAdminPage.test.jsx new file mode 100644 index 000000000..7a4815a2c --- /dev/null +++ b/components/AdminPage/SetBudgetAdminPage/SetBudgetAdminPage.test.jsx @@ -0,0 +1,52 @@ +/** + * @vi-environment jsdom + */ +import React from 'react'; +import { render, screen } from '../../../test-utils'; +import SetBudgetAdminPage from '.'; +import InitialState from '../../../store/Store/InitialState'; +import Constants from '../../../test-utils/constant'; +import userEvent from '@testing-library/user-event'; +import MockOpenQClient from '../../../services/ethers/MockOpenQClient'; + +describe('SetBudgetAdminPage', () => { + const bounty = Constants.bounty; + beforeEach(() => { + InitialState.openQClient.reset(); + const observe = vi.fn(); + const disconnect = vi.fn(); + window.IntersectionObserver = vi.fn(() => ({ + observe, + disconnect, + })); + }); + + describe('Fixed price contracts', () => { + it('should allow user to update budget', async () => { + // ARRANGE + const user = userEvent.setup(); + const setFundingGoal = vi.fn(); + const customInitialState = { + ...InitialState, + openQClient: new MockOpenQClient({ setFundingGoal }), + }; + render( {}} bounty={bounty} />, {}, customInitialState); + expect(screen.getByText('Set a New Budget for this Contract')).toBeInTheDocument(); + + // ACT + await user.type(screen.getByRole('textbox'), '100'); + await user.click(screen.getByRole('button', { name: 'select token' })); + await user.click(screen.getByRole('button', { name: /link/i })); + await user.click(await screen.findByRole('button', { name: 'Set New Budget' })); + + // ASSERT + expect(await screen.findByText(/Updating Budget.../)).toBeInTheDocument(); + expect(screen.getByText(/our request is being processed.../)).toBeInTheDocument(); + const updatedTexts = await screen.findAllByText(/updated/i); + expect(updatedTexts[0]).toBeInTheDocument(); + expect(await screen.findByText(/budget set to/i)).toBeInTheDocument(); + expect(await screen.findByText(/100.0 LINK/)).toBeInTheDocument(); + expect(setFundingGoal).toBeCalledWith(bounty.bountyId, '100', '0x5FbDB2315678afecb367f032d93F642f64180aa3'); + }); + }); +}); diff --git a/components/AdminPage/SetBudgetAdminPage/__snapshots__/SetBudgetAdminPage.test.js.snap b/components/AdminPage/SetBudgetAdminPage/__snapshots__/SetBudgetAdminPage.test.js.snap index 7df1b0927..82d5f7855 100644 --- a/components/AdminPage/SetBudgetAdminPage/__snapshots__/SetBudgetAdminPage.test.js.snap +++ b/components/AdminPage/SetBudgetAdminPage/__snapshots__/SetBudgetAdminPage.test.js.snap @@ -1,4 +1,4 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// vi Snapshot v1, https://goo.gl/fbAQLP exports[`SetBudgetAdminPage Split Price Contracts should allow user to update budget token and volume when no deposits: Snapshot: initial view 1`] = ` diff --git a/components/AdminPage/SetBudgetAdminPage/index.js b/components/AdminPage/SetBudgetAdminPage/index.jsx similarity index 100% rename from components/AdminPage/SetBudgetAdminPage/index.js rename to components/AdminPage/SetBudgetAdminPage/index.jsx diff --git a/components/AdminPage/SetTierAdminPage/SetTierAdminPage.test.js b/components/AdminPage/SetTierAdminPage/SetTierAdminPage.test.jsx similarity index 95% rename from components/AdminPage/SetTierAdminPage/SetTierAdminPage.test.js rename to components/AdminPage/SetTierAdminPage/SetTierAdminPage.test.jsx index 0c203d038..3315c875c 100644 --- a/components/AdminPage/SetTierAdminPage/SetTierAdminPage.test.js +++ b/components/AdminPage/SetTierAdminPage/SetTierAdminPage.test.jsx @@ -9,9 +9,9 @@ import { waitFor } from '@testing-library/react'; describe('SetTierAdminPage', () => { beforeEach(() => { InitialState.openQClient.reset(); - const observe = jest.fn(); - const disconnect = jest.fn(); - window.IntersectionObserver = jest.fn(() => ({ + const observe = vi.fn(); + const disconnect = vi.fn(); + window.IntersectionObserver = vi.fn(() => ({ observe, disconnect, })); @@ -42,7 +42,7 @@ describe('SetTierAdminPage', () => { const bounty = Constants.bounty3; // ARRANGE const user = userEvent.setup(); - const setTier = jest.fn(); + const setTier = vi.fn(); const customInitialState = { ...InitialState, openQClient: new MockOpenQClient({ setTier }), diff --git a/components/AdminPage/SetTierAdminPage/__snapshots__/SetTierAdminPage.test.js.snap b/components/AdminPage/SetTierAdminPage/__snapshots__/SetTierAdminPage.test.js.snap index 1466e9974..5bf13cfac 100644 --- a/components/AdminPage/SetTierAdminPage/__snapshots__/SetTierAdminPage.test.js.snap +++ b/components/AdminPage/SetTierAdminPage/__snapshots__/SetTierAdminPage.test.js.snap @@ -1,4 +1,4 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// vi Snapshot v1, https://goo.gl/fbAQLP exports[`SetTierAdminPage should match DOM and render "Which token?", "Volumes:" if bounty type is 3 1`] = ` diff --git a/components/AdminPage/SetTierAdminPage/__snapshots__/SetTierAdminPage.test.jsx.snap b/components/AdminPage/SetTierAdminPage/__snapshots__/SetTierAdminPage.test.jsx.snap new file mode 100644 index 000000000..c900cd039 --- /dev/null +++ b/components/AdminPage/SetTierAdminPage/__snapshots__/SetTierAdminPage.test.jsx.snap @@ -0,0 +1,242 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`SetTierAdminPage > should match DOM and render "Which token?", "Volumes:" if bounty type is 3 1`] = ` + +
+
+
+ How many Tiers? +
+
+ ? +
+ +
+
+ +
+
+
+
+
+ Which token? +
+
+ ? +
+ +
+
+
+
+
+ +
+
+
+
+
+ Volumes: +
+
+
+
+ 1st +
+
+ +
+
+
+
+ 2nd +
+
+ +
+
+
+
+ 3rd +
+
+ +
+
+
+
+
+
+ +
+ +`; + +exports[`SetTierAdminPage > should render nothing if bounty type is 0 1`] = ``; + +exports[`SetTierAdminPage > should render nothing if bounty type is 1 1`] = ``; diff --git a/components/AdminPage/SetTierAdminPage/index.js b/components/AdminPage/SetTierAdminPage/index.jsx similarity index 99% rename from components/AdminPage/SetTierAdminPage/index.js rename to components/AdminPage/SetTierAdminPage/index.jsx index 579b0caa1..a8181237a 100644 --- a/components/AdminPage/SetTierAdminPage/index.js +++ b/components/AdminPage/SetTierAdminPage/index.jsx @@ -6,7 +6,7 @@ import useIsOnCorrectNetwork from '../../../hooks/useIsOnCorrectNetwork'; import ConnectButton from '../../WalletConnect/ConnectButton'; import TokenSearch from '../../TokenSelection/TokenSearch'; import SetTierValues from '../../MintBounty/MintBountyModal/AddContestParams/SetTierValues'; -import AdminModal from '../AdminModal/index.js'; +import AdminModal from '../AdminModal'; import TokenContext from '../../TokenSelection/TokenStore/TokenContext'; import { ethers } from 'ethers'; diff --git a/components/AdminPage/index.js b/components/AdminPage/index.jsx similarity index 100% rename from components/AdminPage/index.js rename to components/AdminPage/index.jsx diff --git a/components/Authentication/AuthButton.js b/components/Authentication/AuthButton.jsx similarity index 100% rename from components/Authentication/AuthButton.js rename to components/Authentication/AuthButton.jsx diff --git a/components/Authentication/EmailLogin.js b/components/Authentication/EmailLogin.jsx similarity index 100% rename from components/Authentication/EmailLogin.js rename to components/Authentication/EmailLogin.jsx diff --git a/components/Authentication/FirstSignupModal/AddSkill/AddSkill.test.js b/components/Authentication/FirstSignupModal/AddSkill/AddSkill.test.jsx similarity index 94% rename from components/Authentication/FirstSignupModal/AddSkill/AddSkill.test.js rename to components/Authentication/FirstSignupModal/AddSkill/AddSkill.test.jsx index 3b50a795e..584a1e2da 100644 --- a/components/Authentication/FirstSignupModal/AddSkill/AddSkill.test.js +++ b/components/Authentication/FirstSignupModal/AddSkill/AddSkill.test.jsx @@ -23,7 +23,7 @@ describe('Add Skill', () => { frameworks: [], }; it('should match initial DOM Snapshot', () => { - const setRolesInCategoriesState = jest.fn(); + const setRolesInCategoriesState = vi.fn(); const rolesInCategoriesState = [{ languages: user.languages }, setRolesInCategoriesState]; const { asFragment } = render( { expect(asFragment()).toMatchSnapshot(); }); it('setInputValue to have been called', async () => { - const setRolesInCategoriesState = jest.fn(); + const setRolesInCategoriesState = vi.fn(); const rolesInCategoriesState = [{ languages: user.languages }, setRolesInCategoriesState]; render(); const buttons = screen.getAllByRole('button'); diff --git a/components/Authentication/FirstSignupModal/AddSkill/__snapshots__/AddSkill.test.js.snap b/components/Authentication/FirstSignupModal/AddSkill/__snapshots__/AddSkill.test.js.snap index a6bbe2459..3193903fa 100644 --- a/components/Authentication/FirstSignupModal/AddSkill/__snapshots__/AddSkill.test.js.snap +++ b/components/Authentication/FirstSignupModal/AddSkill/__snapshots__/AddSkill.test.js.snap @@ -1,4 +1,4 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// vi Snapshot v1, https://goo.gl/fbAQLP exports[`Add Skill should match initial DOM Snapshot 1`] = ` diff --git a/components/Authentication/FirstSignupModal/AddSkill/__snapshots__/AddSkill.test.jsx.snap b/components/Authentication/FirstSignupModal/AddSkill/__snapshots__/AddSkill.test.jsx.snap new file mode 100644 index 000000000..d98f11f0e --- /dev/null +++ b/components/Authentication/FirstSignupModal/AddSkill/__snapshots__/AddSkill.test.jsx.snap @@ -0,0 +1,108 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Add Skill > should match initial DOM Snapshot 1`] = ` + + + + + + + + +`; diff --git a/components/Authentication/FirstSignupModal/AddSkill/index.js b/components/Authentication/FirstSignupModal/AddSkill/index.jsx similarity index 100% rename from components/Authentication/FirstSignupModal/AddSkill/index.js rename to components/Authentication/FirstSignupModal/AddSkill/index.jsx diff --git a/components/Authentication/FirstSignupModal/FirstSignupModal.test.js b/components/Authentication/FirstSignupModal/FirstSignupModal.test.jsx similarity index 91% rename from components/Authentication/FirstSignupModal/FirstSignupModal.test.js rename to components/Authentication/FirstSignupModal/FirstSignupModal.test.jsx index c41f683b0..3ca8bb4b6 100644 --- a/components/Authentication/FirstSignupModal/FirstSignupModal.test.js +++ b/components/Authentication/FirstSignupModal/FirstSignupModal.test.jsx @@ -4,12 +4,12 @@ import FirstSignupModal from '.'; import nextRouter from 'next/router'; describe('FirstSignupModal', () => { - nextRouter.useRouter = jest.fn(); + nextRouter.useRouter = vi.fn(); nextRouter.useRouter.mockImplementation(() => ({ query: { type: null }, - prefetch: jest.fn(() => { - return { catch: jest.fn }; + prefetch: vi.fn(() => { + return { catch: vi.fn }; }), })); const user = { diff --git a/components/Authentication/FirstSignupModal/LanguagesAndFrameworks/LanguagesAndFrameworks.test.js b/components/Authentication/FirstSignupModal/LanguagesAndFrameworks/LanguagesAndFrameworks.test.jsx similarity index 100% rename from components/Authentication/FirstSignupModal/LanguagesAndFrameworks/LanguagesAndFrameworks.test.js rename to components/Authentication/FirstSignupModal/LanguagesAndFrameworks/LanguagesAndFrameworks.test.jsx diff --git a/components/Authentication/FirstSignupModal/LanguagesAndFrameworks/__snapshots__/LanguagesAndFrameworks.test.js.snap b/components/Authentication/FirstSignupModal/LanguagesAndFrameworks/__snapshots__/LanguagesAndFrameworks.test.js.snap index 728511c1e..4b21d6894 100644 --- a/components/Authentication/FirstSignupModal/LanguagesAndFrameworks/__snapshots__/LanguagesAndFrameworks.test.js.snap +++ b/components/Authentication/FirstSignupModal/LanguagesAndFrameworks/__snapshots__/LanguagesAndFrameworks.test.js.snap @@ -1,4 +1,4 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// vi Snapshot v1, https://goo.gl/fbAQLP exports[`Languages and Frameworks should match initial DOM Snapshot 1`] = ` diff --git a/components/Authentication/FirstSignupModal/LanguagesAndFrameworks/__snapshots__/LanguagesAndFrameworks.test.jsx.snap b/components/Authentication/FirstSignupModal/LanguagesAndFrameworks/__snapshots__/LanguagesAndFrameworks.test.jsx.snap new file mode 100644 index 000000000..11e9613f4 --- /dev/null +++ b/components/Authentication/FirstSignupModal/LanguagesAndFrameworks/__snapshots__/LanguagesAndFrameworks.test.jsx.snap @@ -0,0 +1,28 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Languages and Frameworks > should match initial DOM Snapshot 1`] = ` + +

+ Tell us about your skills +

+
+
+ + +
+ +`; diff --git a/components/Authentication/FirstSignupModal/LanguagesAndFrameworks/index.js b/components/Authentication/FirstSignupModal/LanguagesAndFrameworks/index.jsx similarity index 100% rename from components/Authentication/FirstSignupModal/LanguagesAndFrameworks/index.js rename to components/Authentication/FirstSignupModal/LanguagesAndFrameworks/index.jsx diff --git a/components/Authentication/FirstSignupModal/__snapshots__/FirstSignupModal.test.js.snap b/components/Authentication/FirstSignupModal/__snapshots__/FirstSignupModal.test.js.snap index 116f569c6..80bf1ec75 100644 --- a/components/Authentication/FirstSignupModal/__snapshots__/FirstSignupModal.test.js.snap +++ b/components/Authentication/FirstSignupModal/__snapshots__/FirstSignupModal.test.js.snap @@ -1,4 +1,4 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// vi Snapshot v1, https://goo.gl/fbAQLP exports[`FirstSignupModal should match initial DOM Snapshot 1`] = ` diff --git a/components/Authentication/FirstSignupModal/__snapshots__/FirstSignupModal.test.jsx.snap b/components/Authentication/FirstSignupModal/__snapshots__/FirstSignupModal.test.jsx.snap new file mode 100644 index 000000000..02c12b364 --- /dev/null +++ b/components/Authentication/FirstSignupModal/__snapshots__/FirstSignupModal.test.jsx.snap @@ -0,0 +1,354 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`FirstSignupModal > should match initial DOM Snapshot 1`] = ` + +
+
+
+
+ +
+
+
+ openq-logo +
+
+
+ +
+
+
+
+
+
+

+ Hello +

+

+ If you're coming here as an EthDenver Buidlathon winner, congratulations! +

+

+ Let's get you paid. +

+

+ Enter your email to stay up to date with next steps in claiming your award. +

+

+ OpenQ and EthDenver will use this email to tell you when you uploaded forms have been approved, after which you can claim right away. +

+
+
+
+
+
+
+ + +
+
+ This email will be used by organizations to communicate with you. OpenQ will also send copies of any documents you send to organizers via our interface. +
+
+ +
+
+
+

+ Now, tell us a bit about yourself +

+
+

+ Username: +

+
+
+
+
+ +
+
+
+
+

+ What is your role? +

+ + + + + + + + + +

+ Tell us about your skills +

+
+
+ + +
+

+ Which OpenQ products are you interested in? +

+ + + + +
+
+ +

+ Join hundreds of professionals learning with OpenQ +

+
+
+

+ Curated emails on the latest software and web3 topics, product updates, events and new opportunities for your career. +

+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+ +`; diff --git a/components/Authentication/FirstSignupModal/index.js b/components/Authentication/FirstSignupModal/index.jsx similarity index 100% rename from components/Authentication/FirstSignupModal/index.js rename to components/Authentication/FirstSignupModal/index.jsx diff --git a/__tests__/Authentication/GithubSignIn.test.js b/components/Authentication/GithubSignIn/GithubSignIn.test.jsx similarity index 70% rename from __tests__/Authentication/GithubSignIn.test.js rename to components/Authentication/GithubSignIn/GithubSignIn.test.jsx index db27517ed..1012df8e9 100644 --- a/__tests__/Authentication/GithubSignIn.test.js +++ b/components/Authentication/GithubSignIn/GithubSignIn.test.jsx @@ -1,14 +1,14 @@ import React from 'react'; -import GithubSignIn from '../../components/Authentication/GithubSignIn'; +import GithubSignIn from '.'; import renderer from 'react-test-renderer'; import nextRouter from 'next/router'; -nextRouter.useRouter = jest.fn(); +nextRouter.useRouter = vi.fn(); nextRouter.useRouter.mockImplementation(() => ({ query: { type: null }, - prefetch: jest.fn(() => { - return { catch: jest.fn }; + prefetch: vi.fn(() => { + return { catch: vi.fn }; }), })); diff --git a/__tests__/Authentication/__snapshots__/GithubSignIn.test.js.snap b/components/Authentication/GithubSignIn/__snapshots__/GithubSignIn.test.jsx.snap similarity index 83% rename from __tests__/Authentication/__snapshots__/GithubSignIn.test.js.snap rename to components/Authentication/GithubSignIn/__snapshots__/GithubSignIn.test.jsx.snap index 3b66d5e4b..9e54f561b 100644 --- a/__tests__/Authentication/__snapshots__/GithubSignIn.test.js.snap +++ b/components/Authentication/GithubSignIn/__snapshots__/GithubSignIn.test.jsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`GithubSignIn Snapshot should match DOM Snapshot 1`] = ` +exports[`GithubSignIn Snapshot > should match DOM Snapshot 1`] = ` +
+ W8/W9 Form +
+
+
+

+ Please complete and upload a form W-8. Choose one of five types, depending on your entity. We encourage you to consult with your own tax or financial adviser to determine which form is appropriate for you. +

+
+

+ 1. + US-flag + W-9 +

+

+ ✅ US Citizen or Resident +

+

+ ✅ Claiming as an individual +

+

+ Instructions: + + https://www.irs.gov/forms-pubs/about-form-w-9 + +

+

+ Form: + + https://www.irs.gov/pub/irs-pdf/fw9.pdf + +

+
+

+ 2. 🌍 W-8-BEN +

+

+ ✅ Not a US Citizen or Resident +

+

+ ✅ Claiming as an individual +

+

+ Instructions: + + https://www.irs.gov/instructions/iw8ben + +

+

+ Form: + + https://www.irs.gov/pub/irs-pdf/fw8ben.pdf + +

+
+

+ 3. 🌎 W-8-BEN-E +

+

+ ✅ Not a US Citizen or Resident +

+

+ ✅ Claiming as an entity +

+

+ Instructions: + + https://www.irs.gov/instructions/iw8bene + +

+

+ Form: + + https://www.irs.gov/pub/irs-pdf/fw8bene.pdf + +

+
+

+ 4. 🌎 W-8-ECI +

+

+ ✅ Not a US Citizen or Resident +

+

+ ✅ Foreign Person’s Claim That Income is Effectively Connected With the Conduct of a Trade or Business in the United States +

+

+ Instructions: + + https://www.irs.gov/pub/irs-pdf/iw8eci.pdf + +

+

+ Form: + + https://www.irs.gov/pub/irs-pdf/fw8eci.pdf + +

+
+

+ 5. 🌎 W-8-EXP +

+

+ ✅ Not a US Citizen or Resident +

+

+ ✅ Foreign Government or Other Foreign Organization +

+

+ Instructions: + + https://www.irs.gov/pub/irs-pdf/iw8exp.pdf + +

+

+ Form: + + https://www.irs.gov/pub/irs-pdf/fw8exp.pdf + +

+
+

+ 6. 🌎 W-8-IMY +

+

+ ✅ Not a US Citizen or Resident +

+

+ ✅ Foreign Intermediary, Foreign Flow-Through Entity, or Certain U.S. Branches +

+

+ Instructions: + + https://www.irs.gov/individuals/international-taxpayers/form-w-8imy + +

+

+ Form: + + https://www.irs.gov/pub/irs-pdf/fw8imy.pdf + +

+
+

+ The IRS requires us to withhold FIL from payments to non-U.S. citizens who live outside of the United States unless we can associate the payee with a completed, signed W-8/W-9 form. +

+
+
+
+
+
+ +
+
+
+
+
+
+
+ +`; diff --git a/components/Claim/ClaimPage/W8Requirement/W8FormModal/index.js b/components/Claim/ClaimPage/W8Requirement/W8FormModal/index.jsx similarity index 100% rename from components/Claim/ClaimPage/W8Requirement/W8FormModal/index.js rename to components/Claim/ClaimPage/W8Requirement/W8FormModal/index.jsx diff --git a/components/Claim/ClaimPage/W8Requirement/W8Requirement.test.js b/components/Claim/ClaimPage/W8Requirement/W8Requirement.test.jsx similarity index 100% rename from components/Claim/ClaimPage/W8Requirement/W8Requirement.test.js rename to components/Claim/ClaimPage/W8Requirement/W8Requirement.test.jsx diff --git a/components/Claim/ClaimPage/W8Requirement/__snapshots__/W8Requirement.test.js.snap b/components/Claim/ClaimPage/W8Requirement/__snapshots__/W8Requirement.test.js.snap index 504799d8e..9429ea2f5 100644 --- a/components/Claim/ClaimPage/W8Requirement/__snapshots__/W8Requirement.test.js.snap +++ b/components/Claim/ClaimPage/W8Requirement/__snapshots__/W8Requirement.test.js.snap @@ -1,4 +1,4 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// vi Snapshot v1, https://goo.gl/fbAQLP exports[`W8Requirement should match initial DOM Snapshot 1`] = ` diff --git a/components/Claim/ClaimPage/W8Requirement/__snapshots__/W8Requirement.test.jsx.snap b/components/Claim/ClaimPage/W8Requirement/__snapshots__/W8Requirement.test.jsx.snap new file mode 100644 index 000000000..d713d2625 --- /dev/null +++ b/components/Claim/ClaimPage/W8Requirement/__snapshots__/W8Requirement.test.jsx.snap @@ -0,0 +1,159 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`W8Requirement > should match initial DOM Snapshot 1`] = ` + +
+

+ Form W8/W9* +
+ Required +
+

+
+
+ Please complete and upload a W-8/W-9 form (must be in PDF format). Choose one of five types, depending on your entity. We encourage you to consult with you own tax or financial adviser to determine which form is appropriate for you or ask in our +
+ + discord + + for help. +
+
+

+ Please add an email to your profile so that we can send you a copy of the your submitted form. +

+
+
+
+
+ + +
+
+ This email will be used by organizations to communicate with you. OpenQ will also send copies of any documents you send to organizers via our interface. +
+
+ +
+
+
+
+ Explore our W8/W9 templates + + . +
+
+ ✅ PDF File must be less than 6 MB +
+
+ 🔔 Don't forget to add your signature and date to your W8 or W9 Form! +
+
+
+ Pending +
+ +
+ + +
+ *W-8 forms are + + Internal Revenue Service + + (IRS) forms that foreign individuals and businesses must file to verify their country of residence for tax purposes, certifying that they qualify for a lower rate of tax withholding. +
+
+
+`; diff --git a/components/Claim/ClaimPage/W8Requirement/index.js b/components/Claim/ClaimPage/W8Requirement/index.jsx similarity index 100% rename from components/Claim/ClaimPage/W8Requirement/index.js rename to components/Claim/ClaimPage/W8Requirement/index.jsx diff --git a/components/Claim/ClaimPage/index.js b/components/Claim/ClaimPage/index.jsx similarity index 99% rename from components/Claim/ClaimPage/index.js rename to components/Claim/ClaimPage/index.jsx index 27d7fe0f4..2f3a2ccf5 100644 --- a/components/Claim/ClaimPage/index.js +++ b/components/Claim/ClaimPage/index.jsx @@ -4,7 +4,7 @@ import Link from 'next/link'; // Custom import CopyAddressToClipboard from '../../CopyAddressToClipboard'; -import BountyClaimed from './BountyClaimed/index.js'; +import BountyClaimed from './BountyClaimed/index'; import StoreContext from '../../../store/Store/StoreContext'; import ConnectButton from '../../WalletConnect/ConnectButton'; import AuthContext from '../../../store/AuthStore/AuthContext'; diff --git a/components/Claim/ClaimPerToken/ClaimPerToken.test.js b/components/Claim/ClaimPerToken/ClaimPerToken.test.jsx similarity index 93% rename from components/Claim/ClaimPerToken/ClaimPerToken.test.js rename to components/Claim/ClaimPerToken/ClaimPerToken.test.jsx index 2c26e1b3a..9b5b3b228 100755 --- a/components/Claim/ClaimPerToken/ClaimPerToken.test.js +++ b/components/Claim/ClaimPerToken/ClaimPerToken.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import { render, screen } from '../../../test-utils'; @@ -7,9 +7,9 @@ import ClaimPerToken from '.'; import nextRouter from 'next/router'; import Constants from '../../../test-utils/constant'; -nextRouter.useRouter = jest.fn(); -const push = jest.fn(() => { - return { catch: jest.fn }; +nextRouter.useRouter = vi.fn(); +const push = vi.fn(() => { + return { catch: vi.fn }; }); const bounty = { @@ -23,8 +23,8 @@ describe('ClaimPerToken', () => { beforeEach(() => { nextRouter.useRouter.mockImplementation(() => ({ query: { type: null }, - prefetch: jest.fn(() => { - return { catch: jest.fn }; + prefetch: vi.fn(() => { + return { catch: vi.fn }; }), push, })); diff --git a/components/Claim/ClaimPerToken/index.js b/components/Claim/ClaimPerToken/index.jsx similarity index 100% rename from components/Claim/ClaimPerToken/index.js rename to components/Claim/ClaimPerToken/index.jsx diff --git a/components/Claim/ClaimStates.js b/components/Claim/ClaimStates.jsx similarity index 100% rename from components/Claim/ClaimStates.js rename to components/Claim/ClaimStates.jsx diff --git a/components/Claim/Claimants/Claimants.test.js b/components/Claim/Claimants/Claimants.test.jsx similarity index 95% rename from components/Claim/Claimants/Claimants.test.js rename to components/Claim/Claimants/Claimants.test.jsx index 6a09cf7d3..dda25fd6d 100755 --- a/components/Claim/Claimants/Claimants.test.js +++ b/components/Claim/Claimants/Claimants.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import { render, screen } from '../../../test-utils'; diff --git a/components/Claim/Claimants/index.js b/components/Claim/Claimants/index.jsx similarity index 100% rename from components/Claim/Claimants/index.js rename to components/Claim/Claimants/index.jsx diff --git a/components/ContractWizard/ContractWizard.test.js b/components/ContractWizard/ContractWizard.test.jsx similarity index 87% rename from components/ContractWizard/ContractWizard.test.js rename to components/ContractWizard/ContractWizard.test.jsx index 167d7104a..26d2025a4 100755 --- a/components/ContractWizard/ContractWizard.test.js +++ b/components/ContractWizard/ContractWizard.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import { render, screen } from '../../test-utils'; @@ -7,17 +7,22 @@ import ContractWizard from '.'; import userEvent from '@testing-library/user-event'; import ShallowRenderer from 'react-test-renderer/shallow'; import nextRouter from 'next/router'; +import { cleanup } from '@testing-library/react'; -nextRouter.useRouter = jest.fn(); +nextRouter.useRouter = vi.fn(); nextRouter.useRouter.mockImplementation(() => ({ query: { type: null }, - prefetch: jest.fn(() => { - return { catch: jest.fn }; + prefetch: vi.fn(() => { + return { catch: vi.fn }; }), })); describe('ContractWizard', () => { + afterEach(() => { + cleanup(); + }); + it('should render match DOM Snapshot', () => { const shallow = new ShallowRenderer(); shallow.render(); diff --git a/components/ContractWizard/GetSupportModal/GetSupportModal.test.js b/components/ContractWizard/GetSupportModal/GetSupportModal.test.jsx similarity index 92% rename from components/ContractWizard/GetSupportModal/GetSupportModal.test.js rename to components/ContractWizard/GetSupportModal/GetSupportModal.test.jsx index 02b40d347..854d08fbf 100755 --- a/components/ContractWizard/GetSupportModal/GetSupportModal.test.js +++ b/components/ContractWizard/GetSupportModal/GetSupportModal.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import GetSupportModal from '.'; diff --git a/components/ContractWizard/GetSupportModal/__snapshots__/GetSupportModal.test.js.snap b/components/ContractWizard/GetSupportModal/__snapshots__/GetSupportModal.test.js.snap index 9b43d64ab..11cfbe162 100644 --- a/components/ContractWizard/GetSupportModal/__snapshots__/GetSupportModal.test.js.snap +++ b/components/ContractWizard/GetSupportModal/__snapshots__/GetSupportModal.test.js.snap @@ -1,4 +1,4 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// vi Snapshot v1, https://goo.gl/fbAQLP exports[`GetSupportModal should match DOM Snapshot 1`] = `
diff --git a/components/ContractWizard/GetSupportModal/__snapshots__/GetSupportModal.test.jsx.snap b/components/ContractWizard/GetSupportModal/__snapshots__/GetSupportModal.test.jsx.snap new file mode 100644 index 000000000..67fcbaf15 --- /dev/null +++ b/components/ContractWizard/GetSupportModal/__snapshots__/GetSupportModal.test.jsx.snap @@ -0,0 +1,94 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`GetSupportModal > should match DOM Snapshot 1`] = ` +
+
+
+
+ +
+ We didn't find a suitable contract +
+
+

+ Don't worry, you can help us and describe more precisely what kind of contract you want. If we don't have this one yet, we'll be happy to get to it next. +

+

+ Join our Discord and write us in the support channel or send us an email at riccardo@openq.dev +

+
+ +
+
+
+
+`; diff --git a/components/ContractWizard/GetSupportModal/index.js b/components/ContractWizard/GetSupportModal/index.jsx similarity index 100% rename from components/ContractWizard/GetSupportModal/index.js rename to components/ContractWizard/GetSupportModal/index.jsx diff --git a/components/ContractWizard/__snapshots__/ContractWizard.test.js.snap b/components/ContractWizard/__snapshots__/ContractWizard.test.js.snap index 7c5255765..063fce51b 100644 --- a/components/ContractWizard/__snapshots__/ContractWizard.test.js.snap +++ b/components/ContractWizard/__snapshots__/ContractWizard.test.js.snap @@ -1,4 +1,4 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// vi Snapshot v1, https://goo.gl/fbAQLP exports[`ContractWizard should render match DOM Snapshot 1`] = ` diff --git a/components/ContractWizard/__snapshots__/ContractWizard.test.jsx.snap b/components/ContractWizard/__snapshots__/ContractWizard.test.jsx.snap new file mode 100644 index 000000000..7ebc457a6 --- /dev/null +++ b/components/ContractWizard/__snapshots__/ContractWizard.test.jsx.snap @@ -0,0 +1,52 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`ContractWizard > should render match DOM Snapshot 1`] = ` + + + + +
+ } + resetState={[Function]} + setShowModal={true} + title="Contract Wizard" + > +

+ In this section we will help you find the right type of contract for your job. +

+
+ Should only one person complete this task? + +
+ ? +
+
+
+ + +`; diff --git a/components/ContractWizard/index.js b/components/ContractWizard/index.jsx similarity index 100% rename from components/ContractWizard/index.js rename to components/ContractWizard/index.jsx diff --git a/components/CopyAddressToClipboard/CopyAddressToClipboard.test.js b/components/CopyAddressToClipboard/CopyAddressToClipboard.test.jsx similarity index 95% rename from components/CopyAddressToClipboard/CopyAddressToClipboard.test.js rename to components/CopyAddressToClipboard/CopyAddressToClipboard.test.jsx index 6393117cb..e23c92127 100755 --- a/components/CopyAddressToClipboard/CopyAddressToClipboard.test.js +++ b/components/CopyAddressToClipboard/CopyAddressToClipboard.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import CopyAddressToClipboard from '.'; diff --git a/components/CopyAddressToClipboard/__snapshots__/CopyAddressToClipboard.test.js.snap b/components/CopyAddressToClipboard/__snapshots__/CopyAddressToClipboard.test.js.snap index 25d7b1f77..8f53b5ac1 100644 --- a/components/CopyAddressToClipboard/__snapshots__/CopyAddressToClipboard.test.js.snap +++ b/components/CopyAddressToClipboard/__snapshots__/CopyAddressToClipboard.test.js.snap @@ -1,4 +1,4 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// vi Snapshot v1, https://goo.gl/fbAQLP exports[`CopyAddressToClipboard should match DOM Snapshot: and show pa ... ers 1`] = `
should match DOM Snapshot > and show pa ... ers 1`] = ` +
+
+
+ + + +
+
+ pa + ... + ers +
+
+
+`; + +exports[`CopyAddressToClipboard > should match DOM Snapshot > and show pat 1`] = ` +
+
+
+ + + +
+
+ pat + ... + +
+
+
+`; diff --git a/components/CopyAddressToClipboard/index.js b/components/CopyAddressToClipboard/index.jsx similarity index 100% rename from components/CopyAddressToClipboard/index.js rename to components/CopyAddressToClipboard/index.jsx diff --git a/components/Explore/Blog.js b/components/Explore/Blog.jsx similarity index 100% rename from components/Explore/Blog.js rename to components/Explore/Blog.jsx diff --git a/components/Explore/Card/Card.js b/components/Explore/Card/Card.jsx similarity index 100% rename from components/Explore/Card/Card.js rename to components/Explore/Card/Card.jsx diff --git a/components/Explore/Card/CardBody.js b/components/Explore/Card/CardBody.jsx similarity index 100% rename from components/Explore/Card/CardBody.js rename to components/Explore/Card/CardBody.jsx diff --git a/components/Explore/Card/CardFooter.js b/components/Explore/Card/CardFooter.jsx similarity index 100% rename from components/Explore/Card/CardFooter.js rename to components/Explore/Card/CardFooter.jsx diff --git a/components/Explore/Card/CardHeader.js b/components/Explore/Card/CardHeader.jsx similarity index 100% rename from components/Explore/Card/CardHeader.js rename to components/Explore/Card/CardHeader.jsx diff --git a/components/Explore/FancyButton.js b/components/Explore/FancyButton.jsx similarity index 100% rename from components/Explore/FancyButton.js rename to components/Explore/FancyButton.jsx diff --git a/components/Explore/FlexScrollContainer.js b/components/Explore/FlexScrollContainer.jsx similarity index 100% rename from components/Explore/FlexScrollContainer.js rename to components/Explore/FlexScrollContainer.jsx diff --git a/components/Explore/GoodFirstIssues.js b/components/Explore/GoodFirstIssues.jsx similarity index 100% rename from components/Explore/GoodFirstIssues.js rename to components/Explore/GoodFirstIssues.jsx diff --git a/components/Explore/Hackathons.js b/components/Explore/Hackathons.jsx similarity index 100% rename from components/Explore/Hackathons.js rename to components/Explore/Hackathons.jsx diff --git a/components/Explore/Header.js b/components/Explore/Header.jsx similarity index 100% rename from components/Explore/Header.js rename to components/Explore/Header.jsx diff --git a/components/Explore/ImageTeaser/ImageTeaser.js b/components/Explore/ImageTeaser/ImageTeaser.jsx similarity index 100% rename from components/Explore/ImageTeaser/ImageTeaser.js rename to components/Explore/ImageTeaser/ImageTeaser.jsx diff --git a/components/Explore/ImageTeaser/ImageTeaserHeadline.js b/components/Explore/ImageTeaser/ImageTeaserHeadline.jsx similarity index 100% rename from components/Explore/ImageTeaser/ImageTeaserHeadline.js rename to components/Explore/ImageTeaser/ImageTeaserHeadline.jsx diff --git a/components/Explore/ImageTeaser/ImageTeaserLink.js b/components/Explore/ImageTeaser/ImageTeaserLink.jsx similarity index 100% rename from components/Explore/ImageTeaser/ImageTeaserLink.js rename to components/Explore/ImageTeaser/ImageTeaserLink.jsx diff --git a/components/Explore/ImageTeaser/ImageTeaserText.js b/components/Explore/ImageTeaser/ImageTeaserText.jsx similarity index 100% rename from components/Explore/ImageTeaser/ImageTeaserText.js rename to components/Explore/ImageTeaser/ImageTeaserText.jsx diff --git a/components/Explore/Marketplace.js b/components/Explore/Marketplace.jsx similarity index 100% rename from components/Explore/Marketplace.js rename to components/Explore/Marketplace.jsx diff --git a/components/Explore/Newsletter.js b/components/Explore/Newsletter.jsx similarity index 100% rename from components/Explore/Newsletter.js rename to components/Explore/Newsletter.jsx diff --git a/components/Explore/RepoLanguage.js b/components/Explore/RepoLanguage.jsx similarity index 100% rename from components/Explore/RepoLanguage.js rename to components/Explore/RepoLanguage.jsx diff --git a/components/Explore/Search.js b/components/Explore/Search.jsx similarity index 100% rename from components/Explore/Search.js rename to components/Explore/Search.jsx diff --git a/components/Explore/StarButton.js b/components/Explore/StarButton.jsx similarity index 100% rename from components/Explore/StarButton.js rename to components/Explore/StarButton.jsx diff --git a/components/FundBounty/ApproveFundModal/ApproveFundModal.test.js b/components/FundBounty/ApproveFundModal/ApproveFundModal.test.jsx similarity index 97% rename from components/FundBounty/ApproveFundModal/ApproveFundModal.test.js rename to components/FundBounty/ApproveFundModal/ApproveFundModal.test.jsx index 4bab6c9b7..da8c46cdf 100755 --- a/components/FundBounty/ApproveFundModal/ApproveFundModal.test.js +++ b/components/FundBounty/ApproveFundModal/ApproveFundModal.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import { render, screen } from '../../../test-utils'; @@ -17,8 +17,8 @@ describe('ApproveFundModal', () => { InitialState.openQClient.reset(); }); const bounty = Constants.bounty; - const fundBounty = jest.fn(); - const refreshBounty = jest.fn(); + const fundBounty = vi.fn(); + const refreshBounty = vi.fn(); const fundState = { ...InitialFundState, @@ -28,7 +28,7 @@ describe('ApproveFundModal', () => { approveTransferState: CONFIRM, bounty, }; - const fundDispatch = jest.fn(); + const fundDispatch = vi.fn(); it('should display checking elgibility', async () => { // ARRANGE diff --git a/components/FundBounty/ApproveFundModal/index.js b/components/FundBounty/ApproveFundModal/index.jsx similarity index 100% rename from components/FundBounty/ApproveFundModal/index.js rename to components/FundBounty/ApproveFundModal/index.jsx diff --git a/components/FundBounty/FundPage/FundPage.test.js b/components/FundBounty/FundPage/FundPage.test.jsx similarity index 97% rename from components/FundBounty/FundPage/FundPage.test.js rename to components/FundBounty/FundPage/FundPage.test.jsx index 7629585eb..3b907df6d 100755 --- a/components/FundBounty/FundPage/FundPage.test.js +++ b/components/FundBounty/FundPage/FundPage.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import { render, screen } from '../../../test-utils'; @@ -21,19 +21,19 @@ describe('FundPage', () => { return null; }; beforeEach(() => { - const observe = jest.fn(); - const disconnect = jest.fn(); + const observe = vi.fn(); + const disconnect = vi.fn(); - window.IntersectionObserver = jest.fn(() => ({ + window.IntersectionObserver = vi.fn(() => ({ observe, disconnect, })); - nextRouter.useRouter = jest.fn(); + nextRouter.useRouter = vi.fn(); nextRouter.useRouter.mockImplementation(() => ({ query: { type: null }, - prefetch: jest.fn(() => { - return { catch: jest.fn }; + prefetch: vi.fn(() => { + return { catch: vi.fn }; }), })); InitialState.openQClient.reset(); @@ -69,7 +69,7 @@ describe('FundPage', () => { payoutTokenAddress: '0x5fbdb2315678afecb367f032d93f642f64180aa3', }; const user = userEvent.setup(); - const setInternalMenu = jest.fn(); + const setInternalMenu = vi.fn(); render( @@ -187,7 +187,7 @@ describe('FundPage', () => { volume: '3', approveTransferState: CONFIRM, }; - const dispatch = jest.fn(); + const dispatch = vi.fn(); render( diff --git a/components/FundBounty/FundPage/__snapshots__/FundPage.test.js.snap b/components/FundBounty/FundPage/__snapshots__/FundPage.test.js.snap index 37b5b6537..7ed227fc0 100644 --- a/components/FundBounty/FundPage/__snapshots__/FundPage.test.js.snap +++ b/components/FundBounty/FundPage/__snapshots__/FundPage.test.js.snap @@ -1,4 +1,4 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// vi Snapshot v1, https://goo.gl/fbAQLP exports[`FundPage Split Price Bounties should lock token choice to deposit token when there is 1+ deposit 1`] = ` diff --git a/components/FundBounty/FundPage/__snapshots__/FundPage.test.jsx.snap b/components/FundBounty/FundPage/__snapshots__/FundPage.test.jsx.snap new file mode 100644 index 000000000..88a846495 --- /dev/null +++ b/components/FundBounty/FundPage/__snapshots__/FundPage.test.jsx.snap @@ -0,0 +1,204 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`FundPage > Split Price Bounties > should lock token choice to deposit token when there is 1+ deposit > Snapshot: button style changes to not appear as button 1`] = ` + +`; + +exports[`FundPage > Split Price Bounties > should lock token choice to deposit token when there is 1+ deposit 1`] = ` + +
+
+
+ Escrow Funds in Split Price Contract +
+
+
+
+
+
+ +
+
+
+ +
+
+
+
+
+
+
+
+
+ ? +
+ + + Deposit Locked Period + +
+
+ +
+
+
+
+ + +
+
+
+
+
+ +`; diff --git a/components/FundBounty/FundPage/index.js b/components/FundBounty/FundPage/index.jsx similarity index 100% rename from components/FundBounty/FundPage/index.js rename to components/FundBounty/FundPage/index.jsx diff --git a/components/FundBounty/FundStore/ApproveFundState.js b/components/FundBounty/FundStore/ApproveFundState.jsx similarity index 100% rename from components/FundBounty/FundStore/ApproveFundState.js rename to components/FundBounty/FundStore/ApproveFundState.jsx diff --git a/components/FundBounty/FundStore/FundContext.js b/components/FundBounty/FundStore/FundContext.jsx similarity index 100% rename from components/FundBounty/FundStore/FundContext.js rename to components/FundBounty/FundStore/FundContext.jsx diff --git a/components/FundBounty/FundStore/FundProvider.js b/components/FundBounty/FundStore/FundProvider.jsx similarity index 79% rename from components/FundBounty/FundStore/FundProvider.js rename to components/FundBounty/FundStore/FundProvider.jsx index 8ba4f727e..fe90cc050 100644 --- a/components/FundBounty/FundStore/FundProvider.js +++ b/components/FundBounty/FundStore/FundProvider.jsx @@ -1,7 +1,7 @@ import React, { useReducer } from 'react'; import FundReducer from './FundReducer'; -import FundContext from '../FundStore/FundContext'; -import InitialState from './InitialFundState.js'; +import FundContext from './FundContext'; +import InitialState from './InitialFundState'; const FundProvider = ({ children, bounty, refreshBounty, setInternalMenu }) => { const [state, dispatch] = useReducer(FundReducer, { bounty, refreshBounty, setInternalMenu, ...InitialState }); diff --git a/components/TokenSelection/TokenStore/TestTokenProvider.js b/components/FundBounty/FundStore/TestFundProvider.jsx similarity index 79% rename from components/TokenSelection/TokenStore/TestTokenProvider.js rename to components/FundBounty/FundStore/TestFundProvider.jsx index 99b82426e..b15947f07 100644 --- a/components/TokenSelection/TokenStore/TestTokenProvider.js +++ b/components/FundBounty/FundStore/TestFundProvider.jsx @@ -1,7 +1,7 @@ import React, { useReducer } from 'react'; import FundReducer from './FundReducer'; -import FundContext from '../FundStore/FundContext'; -import InitialState from './InitialFundState.js'; +import FundContext from './FundContext'; +import InitialState from './InitialFundState'; const TestFundProvider = ({ children, bounty, refreshBounty, StoreProps }) => { const [state, dispatch] = useReducer(FundReducer, { bounty, refreshBounty, ...InitialState, ...StoreProps }); diff --git a/components/FundBounty/hooks/useApprove/index.js b/components/FundBounty/hooks/useApprove/index.jsx similarity index 100% rename from components/FundBounty/hooks/useApprove/index.js rename to components/FundBounty/hooks/useApprove/index.jsx diff --git a/components/FundBounty/hooks/useApprove/useApprove.test.js b/components/FundBounty/hooks/useApprove/useApprove.test.jsx similarity index 94% rename from components/FundBounty/hooks/useApprove/useApprove.test.js rename to components/FundBounty/hooks/useApprove/useApprove.test.jsx index 65e179a90..53c5a04eb 100644 --- a/components/FundBounty/hooks/useApprove/useApprove.test.js +++ b/components/FundBounty/hooks/useApprove/useApprove.test.jsx @@ -8,8 +8,8 @@ import { BigNumber } from 'ethers'; describe('useApprove', () => { it('should approve', async () => { await waitFor(async () => { - const approveMock = jest.fn(); - const errorMock = jest.fn(); + const approveMock = vi.fn(); + const errorMock = vi.fn(); const customInitialState = { ...InitialState, openQClient: { ...InitialState.openQClient, approve: approveMock, handleError: errorMock }, @@ -36,7 +36,7 @@ describe('useApprove', () => { }); it('should reject if missing address', async () => { await waitFor(async () => { - const errorMock = jest.fn(); + const errorMock = vi.fn(); const customInitialState = { ...InitialState, openQClient: { ...InitialState.openQClient, handleError: errorMock }, diff --git a/components/FundBounty/hooks/useCheckAccountBalance/index.js b/components/FundBounty/hooks/useCheckAccountBalance/index.jsx similarity index 100% rename from components/FundBounty/hooks/useCheckAccountBalance/index.js rename to components/FundBounty/hooks/useCheckAccountBalance/index.jsx diff --git a/components/FundBounty/hooks/useCheckAddressLimit/index.js b/components/FundBounty/hooks/useCheckAddressLimit/index.jsx similarity index 100% rename from components/FundBounty/hooks/useCheckAddressLimit/index.js rename to components/FundBounty/hooks/useCheckAddressLimit/index.jsx diff --git a/components/FundBounty/hooks/useFundBounty/index.js b/components/FundBounty/hooks/useFundBounty/index.jsx similarity index 100% rename from components/FundBounty/hooks/useFundBounty/index.js rename to components/FundBounty/hooks/useFundBounty/index.jsx diff --git a/components/FundBounty/hooks/useFundBountyMethod/index.js b/components/FundBounty/hooks/useFundBountyMethod/index.jsx similarity index 100% rename from components/FundBounty/hooks/useFundBountyMethod/index.js rename to components/FundBounty/hooks/useFundBountyMethod/index.jsx diff --git a/components/FundBounty/hooks/useFundBountyMethod/useFundBountyMethod.test.js b/components/FundBounty/hooks/useFundBountyMethod/useFundBountyMethod.test.jsx similarity index 90% rename from components/FundBounty/hooks/useFundBountyMethod/useFundBountyMethod.test.js rename to components/FundBounty/hooks/useFundBountyMethod/useFundBountyMethod.test.jsx index 53bd79407..0fc9c3366 100644 --- a/components/FundBounty/hooks/useFundBountyMethod/useFundBountyMethod.test.js +++ b/components/FundBounty/hooks/useFundBountyMethod/useFundBountyMethod.test.jsx @@ -7,9 +7,9 @@ import Constants from '../../../../test-utils/constant'; describe('useFundMethod', () => { it('should approve and fund normal bounties', async () => { await waitFor(async () => { - const approveMock = jest.fn(); - const fundMock = jest.fn(); - const errorMock = jest.fn(); + const approveMock = vi.fn(); + const fundMock = vi.fn(); + const errorMock = vi.fn(); const fundBountyCombined = () => { fundMock(); return InitialState.openQClient.fundBounty(); @@ -26,7 +26,7 @@ describe('useFundMethod', () => { const customFundState = { ...InitialFundState, approveTransferState: 'CONFIRM', - refreshBounty: jest.fn(), + refreshBounty: vi.fn(), showApproveTransferModal: true, volume: '3', bounty: Constants.bounty, @@ -42,9 +42,9 @@ describe('useFundMethod', () => { it('should reject if missing address', async () => { await waitFor(async () => { - const approveMock = jest.fn(); - const fundMock = jest.fn(); - const errorMock = jest.fn(); + const approveMock = vi.fn(); + const fundMock = vi.fn(); + const errorMock = vi.fn(); const fundBountyCombined = () => { fundMock(); return InitialState.openQClient.fundBounty(); diff --git a/components/GoodFirstIssues/IssueCard.js b/components/GoodFirstIssues/IssueCard.jsx similarity index 100% rename from components/GoodFirstIssues/IssueCard.js rename to components/GoodFirstIssues/IssueCard.jsx diff --git a/components/GoodFirstIssues/LanguageFilter.js b/components/GoodFirstIssues/LanguageFilter.jsx similarity index 100% rename from components/GoodFirstIssues/LanguageFilter.js rename to components/GoodFirstIssues/LanguageFilter.jsx diff --git a/components/GoodFirstIssues/LanguageFilterLanguage.js b/components/GoodFirstIssues/LanguageFilterLanguage.jsx similarity index 100% rename from components/GoodFirstIssues/LanguageFilterLanguage.js rename to components/GoodFirstIssues/LanguageFilterLanguage.jsx diff --git a/components/GoodFirstIssues/RepoCard.js b/components/GoodFirstIssues/RepoCard.jsx similarity index 100% rename from components/GoodFirstIssues/RepoCard.js rename to components/GoodFirstIssues/RepoCard.jsx diff --git a/components/GoodFirstIssues/TheList.js b/components/GoodFirstIssues/TheList.jsx similarity index 100% rename from components/GoodFirstIssues/TheList.js rename to components/GoodFirstIssues/TheList.jsx diff --git a/components/GoodFirstIssues/TheSidebar.js b/components/GoodFirstIssues/TheSidebar.jsx similarity index 100% rename from components/GoodFirstIssues/TheSidebar.js rename to components/GoodFirstIssues/TheSidebar.jsx diff --git a/components/Invoicing/Invoice.js b/components/Invoicing/Invoice.jsx similarity index 100% rename from components/Invoicing/Invoice.js rename to components/Invoicing/Invoice.jsx diff --git a/components/Layout/Centered.js b/components/Layout/Centered.jsx similarity index 100% rename from components/Layout/Centered.js rename to components/Layout/Centered.jsx diff --git a/components/Layout/ErrorBoundary.js b/components/Layout/ErrorBoundary.jsx similarity index 100% rename from components/Layout/ErrorBoundary.js rename to components/Layout/ErrorBoundary.jsx diff --git a/components/Layout/FirstTimeBanner.js b/components/Layout/FirstTimeBanner/index.jsx similarity index 96% rename from components/Layout/FirstTimeBanner.js rename to components/Layout/FirstTimeBanner/index.jsx index 3f6d4f087..311ec88b4 100755 --- a/components/Layout/FirstTimeBanner.js +++ b/components/Layout/FirstTimeBanner/index.jsx @@ -1,6 +1,6 @@ // Third Party import React, { useState } from 'react'; -import Cross from '../../components/svg/cross'; +import Cross from '../../svg/cross'; const FirstTimeBanner = () => { const [isFirstLaunch] = useState(true); diff --git a/__tests__/Layout/Footer.test.js b/components/Layout/Footer/Footer.test.jsx similarity index 85% rename from __tests__/Layout/Footer.test.js rename to components/Layout/Footer/Footer.test.jsx index 112205d52..1c6a74846 100644 --- a/__tests__/Layout/Footer.test.js +++ b/components/Layout/Footer/Footer.test.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import Footer from '../../components/Layout/Footer'; +import Footer from '.'; import ShallowRenderer from 'react-test-renderer/shallow'; describe('Footer', () => { it('should match DOM Snapshot', () => { diff --git a/__tests__/Layout/__snapshots__/Footer.test.js.snap b/components/Layout/Footer/__snapshots__/Footer.test.jsx.snap similarity index 98% rename from __tests__/Layout/__snapshots__/Footer.test.js.snap rename to components/Layout/Footer/__snapshots__/Footer.test.jsx.snap index 5d5ca9108..575716796 100644 --- a/__tests__/Layout/__snapshots__/Footer.test.js.snap +++ b/components/Layout/Footer/__snapshots__/Footer.test.jsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Footer should match DOM Snapshot 1`] = ` +exports[`Footer > should match DOM Snapshot 1`] = `
diff --git a/components/Layout/Footer.js b/components/Layout/Footer/index.jsx similarity index 97% rename from components/Layout/Footer.js rename to components/Layout/Footer/index.jsx index 85a9bd6db..2316a4aa0 100755 --- a/components/Layout/Footer.js +++ b/components/Layout/Footer/index.jsx @@ -3,12 +3,12 @@ import React, { useState, useEffect, useRef } from 'react'; import { ChevronDownIcon, ChevronUpIcon, LinkExternalIcon } from '@primer/octicons-react'; import { ethers } from 'ethers'; import Link from 'next/link'; -import OpenQSocials from './OpenQSocials'; -import LoadingBar from '../Loading/LoadingBar'; -import NoSSR from '../Utils/NoSSR'; +import OpenQSocials from '../OpenQSocials'; +import LoadingBar from '../../Loading/LoadingBar'; +import NoSSR from '../../Utils/NoSSR'; // Custom -import CopyAddressToClipboard from '../CopyAddressToClipboard'; +import CopyAddressToClipboard from '../../CopyAddressToClipboard'; import Image from 'next/image'; const Footer = () => { diff --git a/__tests__/Layout/Navlinks.test.js b/components/Layout/NavLinks/Navlinks.test.jsx similarity index 69% rename from __tests__/Layout/Navlinks.test.js rename to components/Layout/NavLinks/Navlinks.test.jsx index cd356c27f..58a95df44 100755 --- a/__tests__/Layout/Navlinks.test.js +++ b/components/Layout/NavLinks/Navlinks.test.jsx @@ -1,18 +1,18 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import NavLinks from '../../components/Layout/NavLinks'; +import NavLinks from '.'; import nextRouter from 'next/router'; import renderer from 'react-test-renderer'; describe('NavLinks', () => { - nextRouter.useRouter = jest.fn(); + nextRouter.useRouter = vi.fn(); nextRouter.useRouter.mockImplementation(() => ({ query: { type: null }, - prefetch: jest.fn(() => { - return { catch: jest.fn }; + prefetch: vi.fn(() => { + return { catch: vi.fn }; }), })); it('should match DOM Snapshot', () => { diff --git a/__tests__/Layout/__snapshots__/Navlinks.test.js.snap b/components/Layout/NavLinks/__snapshots__/Navlinks.test.jsx.snap similarity index 91% rename from __tests__/Layout/__snapshots__/Navlinks.test.js.snap rename to components/Layout/NavLinks/__snapshots__/Navlinks.test.jsx.snap index c03bf7f14..0a7e81aea 100644 --- a/__tests__/Layout/__snapshots__/Navlinks.test.js.snap +++ b/components/Layout/NavLinks/__snapshots__/Navlinks.test.jsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`NavLinks should match DOM Snapshot 1`] = ` +exports[`NavLinks > should match DOM Snapshot 1`] = ` [ { const [appState] = useContext(StoreContext); diff --git a/__tests__/Layout/OpenQSocials.test.js b/components/Layout/OpenQSocials/OpenQSocials.test.jsx similarity index 79% rename from __tests__/Layout/OpenQSocials.test.js rename to components/Layout/OpenQSocials/OpenQSocials.test.jsx index f5f050fae..fff8984c0 100644 --- a/__tests__/Layout/OpenQSocials.test.js +++ b/components/Layout/OpenQSocials/OpenQSocials.test.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import OpenQSocials from '../../components/Layout/OpenQSocials'; +import OpenQSocials from '.'; import renderer from 'react-test-renderer'; describe('OpenQSocials', () => { diff --git a/__tests__/Layout/__snapshots__/OpenQSocials.test.js.snap b/components/Layout/OpenQSocials/__snapshots__/OpenQSocials.test.jsx.snap similarity index 97% rename from __tests__/Layout/__snapshots__/OpenQSocials.test.js.snap rename to components/Layout/OpenQSocials/__snapshots__/OpenQSocials.test.jsx.snap index 052677c42..09273eb03 100644 --- a/__tests__/Layout/__snapshots__/OpenQSocials.test.js.snap +++ b/components/Layout/OpenQSocials/__snapshots__/OpenQSocials.test.jsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`OpenQSocials should match DOM Snapshot 1`] = ` +exports[`OpenQSocials > should match DOM Snapshot 1`] = `
diff --git a/components/Layout/OpenQSocials.js b/components/Layout/OpenQSocials/index.jsx similarity index 98% rename from components/Layout/OpenQSocials.js rename to components/Layout/OpenQSocials/index.jsx index f2be5ebec..298e597bf 100755 --- a/components/Layout/OpenQSocials.js +++ b/components/Layout/OpenQSocials/index.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import Discord from '../svg/discord'; +import Discord from '../../svg/discord'; const OpenQSocials = () => { return ( diff --git a/components/Layout/Sidebar.js b/components/Layout/Sidebar.jsx similarity index 100% rename from components/Layout/Sidebar.js rename to components/Layout/Sidebar.jsx diff --git a/components/Loading/ButtonLoadingIcon/index.js b/components/Loading/ButtonLoadingIcon/index.jsx similarity index 100% rename from components/Loading/ButtonLoadingIcon/index.js rename to components/Loading/ButtonLoadingIcon/index.jsx diff --git a/components/Loading/LoadingBar/LoadingBar.test.js b/components/Loading/LoadingBar/LoadingBar.test.jsx similarity index 96% rename from components/Loading/LoadingBar/LoadingBar.test.js rename to components/Loading/LoadingBar/LoadingBar.test.jsx index edf563df4..9a13f3786 100644 --- a/components/Loading/LoadingBar/LoadingBar.test.js +++ b/components/Loading/LoadingBar/LoadingBar.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import { render, screen } from '../../../test-utils'; diff --git a/components/Loading/LoadingBar/index.js b/components/Loading/LoadingBar/index.jsx similarity index 100% rename from components/Loading/LoadingBar/index.js rename to components/Loading/LoadingBar/index.jsx diff --git a/components/Loading/LoadingThread.js b/components/Loading/LoadingThread.jsx similarity index 100% rename from components/Loading/LoadingThread.js rename to components/Loading/LoadingThread.jsx diff --git a/components/MintBounty/InitialMintState.js b/components/MintBounty/InitialMintState.jsx similarity index 100% rename from components/MintBounty/InitialMintState.js rename to components/MintBounty/InitialMintState.jsx diff --git a/components/MintBounty/MintBountyButton/MintBountyButton.test.js b/components/MintBounty/MintBountyButton/MintBountyButton.test.jsx similarity index 93% rename from components/MintBounty/MintBountyButton/MintBountyButton.test.js rename to components/MintBounty/MintBountyButton/MintBountyButton.test.jsx index 700e2c9ca..9a6defcac 100755 --- a/components/MintBounty/MintBountyButton/MintBountyButton.test.js +++ b/components/MintBounty/MintBountyButton/MintBountyButton.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import { render, screen } from '../../../test-utils'; @@ -10,12 +10,12 @@ import renderer from 'react-test-renderer'; import nextRouter from 'next/router'; InitialState.openQClient.shouldSleep = 200; -nextRouter.useRouter = jest.fn(); +nextRouter.useRouter = vi.fn(); nextRouter.useRouter.mockImplementation(() => ({ query: { type: null }, - prefetch: jest.fn(() => { - return { catch: jest.fn }; + prefetch: vi.fn(() => { + return { catch: vi.fn }; }), })); diff --git a/components/MintBounty/MintBountyButton/__snapshots__/MintBountyButton.test.js.snap b/components/MintBounty/MintBountyButton/__snapshots__/MintBountyButton.test.js.snap index f284cc817..54148cb64 100644 --- a/components/MintBounty/MintBountyButton/__snapshots__/MintBountyButton.test.js.snap +++ b/components/MintBounty/MintBountyButton/__snapshots__/MintBountyButton.test.js.snap @@ -1,4 +1,4 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// vi Snapshot v1, https://goo.gl/fbAQLP exports[`MintBountyButton should match DOM Snapshot 1`] = ` +`; diff --git a/components/MintBounty/MintBountyButton/index.js b/components/MintBounty/MintBountyButton/index.jsx similarity index 100% rename from components/MintBounty/MintBountyButton/index.js rename to components/MintBounty/MintBountyButton/index.jsx diff --git a/components/MintBounty/MintBountyModal/AddAlternativeMetadata/AddAlternativeMetadata.test.js b/components/MintBounty/MintBountyModal/AddAlternativeMetadata/AddAlternativeMetadata.test.jsx similarity index 94% rename from components/MintBounty/MintBountyModal/AddAlternativeMetadata/AddAlternativeMetadata.test.js rename to components/MintBounty/MintBountyModal/AddAlternativeMetadata/AddAlternativeMetadata.test.jsx index db3e02d51..f140dd4c6 100644 --- a/components/MintBounty/MintBountyModal/AddAlternativeMetadata/AddAlternativeMetadata.test.js +++ b/components/MintBounty/MintBountyModal/AddAlternativeMetadata/AddAlternativeMetadata.test.jsx @@ -1,6 +1,6 @@ // test/component/WatchButton/WatchButton.test.js /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import { render, screen } from '../../../../test-utils'; @@ -18,7 +18,7 @@ describe('Add AlternativeMetadata', () => { // ARRANGE const user = userEvent.setup(); const mintState = {}; - const mintDispatch = jest.fn(); + const mintDispatch = vi.fn(); render( @@ -37,7 +37,7 @@ describe('Add AlternativeMetadata', () => { // ARRANGE const user = userEvent.setup(); const mintState = { altUrl: 'https://avatars.githubusercontent.com/u/77402538?s=200&v=4', altName: 'agasdf' }; - const mintDispatch = jest.fn(); + const mintDispatch = vi.fn(); render( diff --git a/components/MintBounty/MintBountyModal/AddAlternativeMetadata/index.js b/components/MintBounty/MintBountyModal/AddAlternativeMetadata/index.jsx similarity index 100% rename from components/MintBounty/MintBountyModal/AddAlternativeMetadata/index.js rename to components/MintBounty/MintBountyModal/AddAlternativeMetadata/index.jsx diff --git a/components/MintBounty/MintBountyModal/AddContestParams/AddContestParams.test.js b/components/MintBounty/MintBountyModal/AddContestParams/AddContestParams.test.jsx similarity index 93% rename from components/MintBounty/MintBountyModal/AddContestParams/AddContestParams.test.js rename to components/MintBounty/MintBountyModal/AddContestParams/AddContestParams.test.jsx index 8a21380aa..2ae25a640 100644 --- a/components/MintBounty/MintBountyModal/AddContestParams/AddContestParams.test.js +++ b/components/MintBounty/MintBountyModal/AddContestParams/AddContestParams.test.jsx @@ -1,12 +1,12 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import { render, screen } from '../../../../test-utils'; import AddContestParams from '.'; import InitialMintState from '../../../../components/MintBounty/InitialMintState'; import MintContext from '../../../../components/MintBounty/MintContext'; -//const mockTierVolumeChange = jest.fn(); +//const mockTierVolumeChange = vi.fn(); describe('AddContestParams', () => { const zeroAddressMetadata = { name: 'Matic', @@ -25,7 +25,7 @@ describe('AddContestParams', () => { finalTierVolumes: [33, 34, 33], payoutToken: zeroAddressMetadata, }; - const mintDispatch = jest.fn(); + const mintDispatch = vi.fn(); render( @@ -54,7 +54,7 @@ describe('AddContestParams', () => { finalTierVolumes: [20, 20, 20], payoutToken: zeroAddressMetadata, }; - const mintDispatch = jest.fn(); + const mintDispatch = vi.fn(); await waitFor(async () => { render( diff --git a/components/MintBounty/MintBountyModal/AddContestParams/EnableRegistration/EnableRegistration.test.js b/components/MintBounty/MintBountyModal/AddContestParams/EnableRegistration/EnableRegistration.test.js deleted file mode 100644 index 5fda5943c..000000000 --- a/components/MintBounty/MintBountyModal/AddContestParams/EnableRegistration/EnableRegistration.test.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @jest-environment jsdom - */ -import React from 'react'; -import { render, screen } from '../../../../../test-utils'; -import EnableRegistration from '../../../MintBountyModal/AddContestParams/EnableRegistration'; -import InitialMintState from '../../../InitialMintState'; -import MintContext from '../../../MintContext'; -import userEvent from '@testing-library/user-event'; - -//const mockTierVolumeChange = jest.fn(); -describe('Enable Registration', () => { - const currentDate = new Date('01-01-2023'); - it('should fire event', async () => { - // ARRANGE - const mintState = { - ...InitialMintState.mintState, - startDate: currentDate, - enableRegistration: true, - }; - const mintDispatch = jest.fn(); - - const user = await userEvent.setup(); - render( - - - - ); - - // ACT - await user.click(screen.getByLabelText(/Enable Hackathon Registration/)); - - // ASSERT - expect(mintDispatch).toHaveBeenCalledWith({ - type: 'UPDATE_ENABLE_REGISTRATION', - payload: false, - }); - // expect startdate to be in input - }); - - it('should display inputs', async () => { - // ARRANGE - const mintState = { - ...InitialMintState.mintState, - startDate: currentDate, - enableRegistration: true, - }; - const mintDispatch = jest.fn(); - - const { asFragment } = render( - - - - ); - - // ASSERT - expect(asFragment()).toMatchSnapshot(); - }); -}); diff --git a/components/MintBounty/MintBountyModal/AddContestParams/EnableRegistration/__snapshots__/EnableRegistration.test.js.snap b/components/MintBounty/MintBountyModal/AddContestParams/EnableRegistration/__snapshots__/EnableRegistration.test.js.snap deleted file mode 100644 index 0110ae16d..000000000 --- a/components/MintBounty/MintBountyModal/AddContestParams/EnableRegistration/__snapshots__/EnableRegistration.test.js.snap +++ /dev/null @@ -1,64 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Enable Registration should display inputs 1`] = ` - -
-
- - -
- - Require contestants to sign up for your hackathon contests in this repo. This will allow you to set a timeline, be highlighted on OpenQ, and ensure you can connect with all participants post-hackathon. - -
- - - - -
-`; diff --git a/components/MintBounty/MintBountyModal/AddContestParams/EnableRegistration/index.js b/components/MintBounty/MintBountyModal/AddContestParams/EnableRegistration/index.js deleted file mode 100644 index 474fc87e9..000000000 --- a/components/MintBounty/MintBountyModal/AddContestParams/EnableRegistration/index.js +++ /dev/null @@ -1,86 +0,0 @@ -import React, { useContext } from 'react'; -import MintContext from '../../../MintContext'; - -const EnableRegistration = () => { - const [mintState, mintDispatch] = useContext(MintContext); - const { startDate, registrationDeadline, enableRegistration } = mintState; - const handleStartDate = (e) => { - const dispatch = { - type: 'UPDATE_START_DATE', - payload: e.target.value, - }; - mintDispatch(dispatch); - }; - - const handleRegistrationDeadline = (e) => { - const dispatch = { - type: 'UPDATE_REGISTRATION_DEADLINE', - payload: e.target.value, - }; - mintDispatch(dispatch); - }; - const handleRegistration = (e) => { - const dispatch = { - type: 'UPDATE_ENABLE_REGISTRATION', - payload: e.target.checked, - }; - mintDispatch(dispatch); - }; - - return ( - <> -
-
- - -
- - Require contestants to sign up for your hackathon contests in this repo. This will allow you to set a - timeline, be highlighted on OpenQ, and ensure you can connect with all participants post-hackathon. - -
- {enableRegistration ? ( - <> - - - - - - - ) : null} - - ); -}; -export default EnableRegistration; diff --git a/components/MintBounty/MintBountyModal/AddContestParams/SetPayoutToken/SetPayoutToken.test.js b/components/MintBounty/MintBountyModal/AddContestParams/SetPayoutToken/SetPayoutToken.test.jsx similarity index 91% rename from components/MintBounty/MintBountyModal/AddContestParams/SetPayoutToken/SetPayoutToken.test.js rename to components/MintBounty/MintBountyModal/AddContestParams/SetPayoutToken/SetPayoutToken.test.jsx index b4c32a2c2..e2d2d122c 100644 --- a/components/MintBounty/MintBountyModal/AddContestParams/SetPayoutToken/SetPayoutToken.test.js +++ b/components/MintBounty/MintBountyModal/AddContestParams/SetPayoutToken/SetPayoutToken.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import { render, screen } from '../../../../../test-utils'; @@ -8,7 +8,7 @@ import InitialMintState from '../../..//InitialMintState'; import MintContext from '../../../MintContext'; import { waitFor } from '@testing-library/react'; -//const mockTierVolumeChange = jest.fn(); +//const mockTierVolumeChange = vi.fn(); describe('Tier Input', () => { it('should show tier selecter', async () => { // ARRANGE @@ -25,7 +25,7 @@ describe('Tier Input', () => { type: 3, hideModal: false, }; - const mintDispatch = jest.fn(); + const mintDispatch = vi.fn(); const content = { body: 'This is a test', diff --git a/components/MintBounty/MintBountyModal/AddContestParams/SetPayoutToken/index.js b/components/MintBounty/MintBountyModal/AddContestParams/SetPayoutToken/index.jsx similarity index 100% rename from components/MintBounty/MintBountyModal/AddContestParams/SetPayoutToken/index.js rename to components/MintBounty/MintBountyModal/AddContestParams/SetPayoutToken/index.jsx diff --git a/components/MintBounty/MintBountyModal/AddContestParams/SetTierValues/SetTierValues.test.js b/components/MintBounty/MintBountyModal/AddContestParams/SetTierValues/SetTierValues.test.jsx similarity index 81% rename from components/MintBounty/MintBountyModal/AddContestParams/SetTierValues/SetTierValues.test.js rename to components/MintBounty/MintBountyModal/AddContestParams/SetTierValues/SetTierValues.test.jsx index 2d5345b2c..7cdc4ee96 100755 --- a/components/MintBounty/MintBountyModal/AddContestParams/SetTierValues/SetTierValues.test.js +++ b/components/MintBounty/MintBountyModal/AddContestParams/SetTierValues/SetTierValues.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import { render, screen } from '../../../../../test-utils'; @@ -10,15 +10,15 @@ import ShallowRenderer from 'react-test-renderer/shallow'; describe('SetTier', () => { it.skip('should render match DOM Snapshot', () => { // ARRANGE - nextRouter.useRouter = jest.fn(); + nextRouter.useRouter = vi.fn(); nextRouter.useRouter.mockImplementation(() => ({ query: { type: null }, - prefetch: jest.fn(() => { - return { catch: jest.fn }; + prefetch: vi.fn(() => { + return { catch: vi.fn }; }), })); - const mockSetFinalVolumes = jest.fn(); + const mockSetFinalVolumes = vi.fn(); const shallow = new ShallowRenderer(); shallow.render( { it('should display initial values for volume inputs on', async () => { // ARRANGE - nextRouter.useRouter = jest.fn(); + nextRouter.useRouter = vi.fn(); nextRouter.useRouter.mockImplementation(() => ({ query: { type: null }, - prefetch: jest.fn(() => { - return { catch: jest.fn }; + prefetch: vi.fn(() => { + return { catch: vi.fn }; }), })); - const mockSetFinalVolumes = jest.fn(); + const mockSetFinalVolumes = vi.fn(); render( { it('should show tier selecter', async () => { // ARRANGE diff --git a/components/MintBounty/MintBountyModal/AddContestParams/SetTierValues/TextTierInput/index.js b/components/MintBounty/MintBountyModal/AddContestParams/SetTierValues/TextTierInput/index.jsx similarity index 100% rename from components/MintBounty/MintBountyModal/AddContestParams/SetTierValues/TextTierInput/index.js rename to components/MintBounty/MintBountyModal/AddContestParams/SetTierValues/TextTierInput/index.jsx diff --git a/components/MintBounty/MintBountyModal/AddContestParams/SetTierValues/index.js b/components/MintBounty/MintBountyModal/AddContestParams/SetTierValues/index.jsx similarity index 100% rename from components/MintBounty/MintBountyModal/AddContestParams/SetTierValues/index.js rename to components/MintBounty/MintBountyModal/AddContestParams/SetTierValues/index.jsx diff --git a/components/MintBounty/MintBountyModal/AddContestParams/index.js b/components/MintBounty/MintBountyModal/AddContestParams/index.jsx similarity index 100% rename from components/MintBounty/MintBountyModal/AddContestParams/index.js rename to components/MintBounty/MintBountyModal/AddContestParams/index.jsx diff --git a/components/MintBounty/MintBountyModal/Budgeting/Budgeting.test.js b/components/MintBounty/MintBountyModal/Budgeting/Budgeting.test.jsx similarity index 91% rename from components/MintBounty/MintBountyModal/Budgeting/Budgeting.test.js rename to components/MintBounty/MintBountyModal/Budgeting/Budgeting.test.jsx index ab4f114fd..7f6e7e7fe 100644 --- a/components/MintBounty/MintBountyModal/Budgeting/Budgeting.test.js +++ b/components/MintBounty/MintBountyModal/Budgeting/Budgeting.test.jsx @@ -1,6 +1,6 @@ // test/component/WatchButton/WatchButton.test.js /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import { render, screen } from '../../../../test-utils'; @@ -10,10 +10,10 @@ import Budgeting from '.'; // Test cases for full balances, empty balances, and undefined balances. describe('sample', () => { beforeEach(() => { - const observe = jest.fn(); - const disconnect = jest.fn(); + const observe = vi.fn(); + const disconnect = vi.fn(); - window.IntersectionObserver = jest.fn(() => ({ + window.IntersectionObserver = vi.fn(() => ({ observe, disconnect, })); @@ -23,7 +23,7 @@ describe('sample', () => { // ARRANGE const user = userEvent.setup(); const mintState = { altUrl: 'https://avatars.githubusercontent.com/u/77402538?s=200&v=4', altName: 'agasdf' }; - const mintDispatch = jest.fn(); + const mintDispatch = vi.fn(); const updateToUsdc = { payload: { name: 'Dummy ERC20', diff --git a/components/MintBounty/MintBountyModal/Budgeting/index.js b/components/MintBounty/MintBountyModal/Budgeting/index.jsx similarity index 100% rename from components/MintBounty/MintBountyModal/Budgeting/index.js rename to components/MintBounty/MintBountyModal/Budgeting/index.jsx diff --git a/components/MintBounty/MintBountyModal/ErrorModal/ErrorModal.test.js b/components/MintBounty/MintBountyModal/ErrorModal/ErrorModal.test.jsx similarity index 100% rename from components/MintBounty/MintBountyModal/ErrorModal/ErrorModal.test.js rename to components/MintBounty/MintBountyModal/ErrorModal/ErrorModal.test.jsx diff --git a/components/MintBounty/MintBountyModal/ErrorModal/__snapshots__/ErrorModal.test.js.snap b/components/MintBounty/MintBountyModal/ErrorModal/__snapshots__/ErrorModal.test.js.snap index 7890cd869..da49600b1 100644 --- a/components/MintBounty/MintBountyModal/ErrorModal/__snapshots__/ErrorModal.test.js.snap +++ b/components/MintBounty/MintBountyModal/ErrorModal/__snapshots__/ErrorModal.test.js.snap @@ -1,4 +1,4 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// vi Snapshot v1, https://goo.gl/fbAQLP exports[`ErrorModal should match DOM Snapshot 1`] = `
diff --git a/components/MintBounty/MintBountyModal/ErrorModal/__snapshots__/ErrorModal.test.jsx.snap b/components/MintBounty/MintBountyModal/ErrorModal/__snapshots__/ErrorModal.test.jsx.snap new file mode 100644 index 000000000..989ac5b58 --- /dev/null +++ b/components/MintBounty/MintBountyModal/ErrorModal/__snapshots__/ErrorModal.test.jsx.snap @@ -0,0 +1,65 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`ErrorModal > should match DOM Snapshot 1`] = ` +
+
+
+
+ +
+ Error +
+
+
+ My error message +
+
+
+
+
+ +
+
+
+
+
+
+
+`; diff --git a/components/MintBounty/MintBountyModal/ErrorModal/index.js b/components/MintBounty/MintBountyModal/ErrorModal/index.jsx similarity index 100% rename from components/MintBounty/MintBountyModal/ErrorModal/index.js rename to components/MintBounty/MintBountyModal/ErrorModal/index.jsx diff --git a/components/MintBounty/MintBountyModal/InvoiceRequired/InvoiceableToggle.test.js b/components/MintBounty/MintBountyModal/InvoiceRequired/InvoiceableToggle.test.jsx similarity index 92% rename from components/MintBounty/MintBountyModal/InvoiceRequired/InvoiceableToggle.test.js rename to components/MintBounty/MintBountyModal/InvoiceRequired/InvoiceableToggle.test.jsx index 809f995fe..693f1d5a3 100644 --- a/components/MintBounty/MintBountyModal/InvoiceRequired/InvoiceableToggle.test.js +++ b/components/MintBounty/MintBountyModal/InvoiceRequired/InvoiceableToggle.test.jsx @@ -1,4 +1,4 @@ -/* @jest-environment jsdom +/* @vi-environment jsdom */ import React from 'react'; import { render, screen } from '../../../../test-utils'; @@ -10,7 +10,7 @@ describe('InvoiceableRequired', () => { // Test cases for it('should display invoiceable toggle', async () => { const mintState = {}; - const mintDispatch = jest.fn(); + const mintDispatch = vi.fn(); // ARRANGE render( @@ -24,7 +24,7 @@ describe('InvoiceableRequired', () => { }); it('should let user update invoiceable toggle', async () => { const mintState = {}; - const mintDispatch = jest.fn(); + const mintDispatch = vi.fn(); // ARRANGE const user = userEvent.setup(); render( diff --git a/components/MintBounty/MintBountyModal/InvoiceRequired/index.js b/components/MintBounty/MintBountyModal/InvoiceRequired/index.jsx similarity index 100% rename from components/MintBounty/MintBountyModal/InvoiceRequired/index.js rename to components/MintBounty/MintBountyModal/InvoiceRequired/index.jsx diff --git a/components/MintBounty/MintBountyModal/KycRequiredToggle/KycRequiredToggle.test.js b/components/MintBounty/MintBountyModal/KycRequiredToggle/KycRequiredToggle.test.jsx similarity index 92% rename from components/MintBounty/MintBountyModal/KycRequiredToggle/KycRequiredToggle.test.js rename to components/MintBounty/MintBountyModal/KycRequiredToggle/KycRequiredToggle.test.jsx index b284aa0a3..4cf42e3bb 100644 --- a/components/MintBounty/MintBountyModal/KycRequiredToggle/KycRequiredToggle.test.js +++ b/components/MintBounty/MintBountyModal/KycRequiredToggle/KycRequiredToggle.test.jsx @@ -1,4 +1,4 @@ -/* @jest-environment jsdom +/* @vi-environment jsdom */ import React from 'react'; import { render, screen } from '../../../../test-utils'; @@ -10,7 +10,7 @@ describe('KycRequired', () => { // Test cases for it('KycRequired', async () => { const mintState = {}; - const mintDispatch = jest.fn(); + const mintDispatch = vi.fn(); // ARRANGE render( @@ -24,7 +24,7 @@ describe('KycRequired', () => { }); it('KycRequired', async () => { const mintState = {}; - const mintDispatch = jest.fn(); + const mintDispatch = vi.fn(); // ARRANGE const user = userEvent.setup(); render( diff --git a/components/MintBounty/MintBountyModal/KycRequiredToggle/index.js b/components/MintBounty/MintBountyModal/KycRequiredToggle/index.jsx similarity index 100% rename from components/MintBounty/MintBountyModal/KycRequiredToggle/index.js rename to components/MintBounty/MintBountyModal/KycRequiredToggle/index.jsx diff --git a/components/MintBounty/MintBountyModal/MintBountyInputIssue/BountyAlreadyMintedMessage/BountyAlreadyMintedMessage.test.js b/components/MintBounty/MintBountyModal/MintBountyInputIssue/BountyAlreadyMintedMessage/BountyAlreadyMintedMessage.test.jsx similarity index 96% rename from components/MintBounty/MintBountyModal/MintBountyInputIssue/BountyAlreadyMintedMessage/BountyAlreadyMintedMessage.test.js rename to components/MintBounty/MintBountyModal/MintBountyInputIssue/BountyAlreadyMintedMessage/BountyAlreadyMintedMessage.test.jsx index c7d18f3a8..3672e528e 100755 --- a/components/MintBounty/MintBountyModal/MintBountyInputIssue/BountyAlreadyMintedMessage/BountyAlreadyMintedMessage.test.js +++ b/components/MintBounty/MintBountyModal/MintBountyInputIssue/BountyAlreadyMintedMessage/BountyAlreadyMintedMessage.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import BountyAlreadyMintedMessage from '.'; diff --git a/components/MintBounty/MintBountyModal/MintBountyInputIssue/BountyAlreadyMintedMessage/__snapshots__/BountyAlreadyMintedMessage.test.js.snap b/components/MintBounty/MintBountyModal/MintBountyInputIssue/BountyAlreadyMintedMessage/__snapshots__/BountyAlreadyMintedMessage.test.js.snap index b1d5f084b..9ab6d4e1d 100644 --- a/components/MintBounty/MintBountyModal/MintBountyInputIssue/BountyAlreadyMintedMessage/__snapshots__/BountyAlreadyMintedMessage.test.js.snap +++ b/components/MintBounty/MintBountyModal/MintBountyInputIssue/BountyAlreadyMintedMessage/__snapshots__/BountyAlreadyMintedMessage.test.js.snap @@ -1,4 +1,4 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// vi Snapshot v1, https://goo.gl/fbAQLP exports[`BountyAlreadyMintedMessage should match DOM Snapshot and msg "closed" 1`] = `
should match DOM Snapshot and msg "closed" 1`] = ` + +`; + +exports[`BountyAlreadyMintedMessage > should match DOM Snapshot and msg "is already minted" 1`] = ` +
+
+ Bounty is already + minted + , view + + + + here + + + . +
+
+`; diff --git a/components/MintBounty/MintBountyModal/MintBountyInputIssue/BountyAlreadyMintedMessage/index.js b/components/MintBounty/MintBountyModal/MintBountyInputIssue/BountyAlreadyMintedMessage/index.jsx similarity index 83% rename from components/MintBounty/MintBountyModal/MintBountyInputIssue/BountyAlreadyMintedMessage/index.js rename to components/MintBounty/MintBountyModal/MintBountyInputIssue/BountyAlreadyMintedMessage/index.jsx index 4a787e713..d34f002e8 100755 --- a/components/MintBounty/MintBountyModal/MintBountyInputIssue/BountyAlreadyMintedMessage/index.js +++ b/components/MintBounty/MintBountyModal/MintBountyInputIssue/BountyAlreadyMintedMessage/index.jsx @@ -1,9 +1,7 @@ import React from 'react'; import Link from 'next/link'; -import useWeb3 from '../../../../../hooks/useWeb3'; export default function BountyAlreadyMintedMessage({ bountyAddress, closed, id }) { - const { safe } = useWeb3(); return (
@@ -11,7 +9,7 @@ export default function BountyAlreadyMintedMessage({ bountyAddress, closed, id } diff --git a/components/MintBounty/MintBountyModal/MintBountyInputIssue/IssueDetailsBubble/IssueDetailsBubble.test.js b/components/MintBounty/MintBountyModal/MintBountyInputIssue/IssueDetailsBubble/IssueDetailsBubble.test.jsx similarity index 97% rename from components/MintBounty/MintBountyModal/MintBountyInputIssue/IssueDetailsBubble/IssueDetailsBubble.test.js rename to components/MintBounty/MintBountyModal/MintBountyInputIssue/IssueDetailsBubble/IssueDetailsBubble.test.jsx index f7b5a3dbf..8a9bca802 100755 --- a/components/MintBounty/MintBountyModal/MintBountyInputIssue/IssueDetailsBubble/IssueDetailsBubble.test.js +++ b/components/MintBounty/MintBountyModal/MintBountyInputIssue/IssueDetailsBubble/IssueDetailsBubble.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; @@ -120,7 +120,7 @@ describe('IssueDetailsBubble', () => { enableRegistration: true, issue: mintableIssue, }; - const mintDispatch = jest.fn(); + const mintDispatch = vi.fn(); // ARRANGE render( @@ -141,7 +141,7 @@ describe('IssueDetailsBubble', () => { enableRegistration: true, issue: unmintableIssue, }; - const mintDispatch = jest.fn(); + const mintDispatch = vi.fn(); // ARRANGE render( diff --git a/components/MintBounty/MintBountyModal/MintBountyInputIssue/IssueDetailsBubble/index.js b/components/MintBounty/MintBountyModal/MintBountyInputIssue/IssueDetailsBubble/index.jsx similarity index 100% rename from components/MintBounty/MintBountyModal/MintBountyInputIssue/IssueDetailsBubble/index.js rename to components/MintBounty/MintBountyModal/MintBountyInputIssue/IssueDetailsBubble/index.jsx diff --git a/components/MintBounty/MintBountyModal/MintBountyInputIssue/MintBountyInputIssue/MintBountyInputIssue.test.js b/components/MintBounty/MintBountyModal/MintBountyInputIssue/MintBountyInputIssue/MintBountyInputIssue.test.jsx similarity index 96% rename from components/MintBounty/MintBountyModal/MintBountyInputIssue/MintBountyInputIssue/MintBountyInputIssue.test.js rename to components/MintBounty/MintBountyModal/MintBountyInputIssue/MintBountyInputIssue/MintBountyInputIssue.test.jsx index 5de40ca5b..907df58fc 100755 --- a/components/MintBounty/MintBountyModal/MintBountyInputIssue/MintBountyInputIssue/MintBountyInputIssue.test.js +++ b/components/MintBounty/MintBountyModal/MintBountyInputIssue/MintBountyInputIssue/MintBountyInputIssue.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; @@ -33,7 +33,7 @@ describe('MintBountyInput', () => { payoutVolume: 100, payoutToken: zeroAddressMetadata, }; - const mintDispatch = jest.fn(); + const mintDispatch = vi.fn(); render( diff --git a/components/MintBounty/MintBountyModal/MintBountyInputIssue/MintBountyInputIssue/index.js b/components/MintBounty/MintBountyModal/MintBountyInputIssue/MintBountyInputIssue/index.jsx similarity index 100% rename from components/MintBounty/MintBountyModal/MintBountyInputIssue/MintBountyInputIssue/index.js rename to components/MintBounty/MintBountyModal/MintBountyInputIssue/MintBountyInputIssue/index.jsx diff --git a/components/MintBounty/MintBountyModal/MintBountyModal/MintBountyModal.test.js b/components/MintBounty/MintBountyModal/MintBountyModal/MintBountyModal.test.jsx similarity index 93% rename from components/MintBounty/MintBountyModal/MintBountyModal/MintBountyModal.test.js rename to components/MintBounty/MintBountyModal/MintBountyModal/MintBountyModal.test.jsx index aad3e18cd..a8f8b56bc 100755 --- a/components/MintBounty/MintBountyModal/MintBountyModal/MintBountyModal.test.js +++ b/components/MintBounty/MintBountyModal/MintBountyModal/MintBountyModal.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import { render, screen } from '../../../../test-utils'; @@ -57,14 +57,14 @@ const test = (issue, type) => { payoutVolume: 100, payoutToken: zeroAddressMetadata, }; - const mintDispatch = jest.fn(); + const mintDispatch = vi.fn(); - nextRouter.useRouter = jest.fn(); + nextRouter.useRouter = vi.fn(); nextRouter.useRouter.mockImplementation(() => ({ query: { type: null }, - prefetch: jest.fn(() => { - return { catch: jest.fn }; + prefetch: vi.fn(() => { + return { catch: vi.fn }; }), })); @@ -105,7 +105,7 @@ const test = (issue, type) => { payoutVolume: 100, payoutToken: zeroAddressMetadata, }; - const mintDispatch = jest.fn(); + const mintDispatch = vi.fn(); render( @@ -115,7 +115,7 @@ const test = (issue, type) => { //ASSERT await waitFor(() => { expect(screen.getAllByRole('link')[0].href).toEqual('https://kycdao.xyz/home'); - expect(screen.getAllByRole('link')[1].href).toEqual('http://localhost/terms-of-use'); + expect(screen.getAllByRole('link')[1].href).toEqual('http://localhost:3000/terms-of-use'); expect(screen.getAllByRole('link')[2].href).toEqual( 'https://github.com/OpenQDev/OpenQ-Contracts/tree/production/contracts/Bounty/Implementations' ); @@ -141,7 +141,7 @@ const test = (issue, type) => { payoutVolume: '123', payoutToken: zeroAddressMetadata, }; - const mintDispatch = jest.fn(); + const mintDispatch = vi.fn(); render( @@ -164,6 +164,7 @@ const test = (issue, type) => { }; describe('MintBountyModal', () => { issues.forEach((issue) => { - types.forEach((type) => test(issue, type)); + test(issue, types[0]); + test(issue, types[3]); }); }); diff --git a/components/MintBounty/MintBountyModal/MintBountyModal/index.js b/components/MintBounty/MintBountyModal/MintBountyModal/index.jsx similarity index 100% rename from components/MintBounty/MintBountyModal/MintBountyModal/index.js rename to components/MintBounty/MintBountyModal/MintBountyModal/index.jsx diff --git a/components/MintBounty/MintBountyModal/MintBountyModalButton/MintBountyModalButton.test.js b/components/MintBounty/MintBountyModal/MintBountyModalButton/MintBountyModalButton.test.jsx similarity index 88% rename from components/MintBounty/MintBountyModal/MintBountyModalButton/MintBountyModalButton.test.js rename to components/MintBounty/MintBountyModal/MintBountyModalButton/MintBountyModalButton.test.jsx index a0fa0e9ff..37b3dd590 100755 --- a/components/MintBounty/MintBountyModal/MintBountyModalButton/MintBountyModalButton.test.js +++ b/components/MintBounty/MintBountyModal/MintBountyModalButton/MintBountyModalButton.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; @@ -9,12 +9,12 @@ import MintContext from '../../MintContext'; import InitialMintState from '../../InitialMintState'; import nextRouter from 'next/router'; -nextRouter.useRouter = jest.fn(); +nextRouter.useRouter = vi.fn(); nextRouter.useRouter.mockImplementation(() => ({ query: { type: null }, - prefetch: jest.fn(() => { - return { catch: jest.fn }; + prefetch: vi.fn(() => { + return { catch: vi.fn }; }), })); @@ -57,11 +57,11 @@ it('should be disabled when on correct network, mintable, but start date > end d payoutVolume: 100, payoutToken: zeroAddressMetadata, }; - const mintDispatch = jest.fn(); + const mintDispatch = vi.fn(); render( - + ); @@ -88,11 +88,11 @@ it('should show "choose eligible issue" when on correct network, minted, and sta payoutVolume: 100, payoutToken: zeroAddressMetadata, }; - const mintDispatch = jest.fn(); + const mintDispatch = vi.fn(); render( - + ); @@ -118,11 +118,11 @@ const test = (issue) => { payoutVolume: 100, payoutToken: zeroAddressMetadata, }; - const mintDispatch = jest.fn(); + const mintDispatch = vi.fn(); render( - + ); @@ -144,11 +144,11 @@ const test = (issue) => { payoutVolume: 100, payoutToken: zeroAddressMetadata, }; - const mintDispatch = jest.fn(); + const mintDispatch = vi.fn(); render( - + ); }; diff --git a/components/MintBounty/MintBountyModal/MintBountyModalButton/index.js b/components/MintBounty/MintBountyModal/MintBountyModalButton/index.jsx similarity index 100% rename from components/MintBounty/MintBountyModal/MintBountyModalButton/index.js rename to components/MintBounty/MintBountyModal/MintBountyModalButton/index.jsx diff --git a/components/MintBounty/MintBountyModal/W8RequiredToggle/W8RequiredToggle.test.js b/components/MintBounty/MintBountyModal/W8RequiredToggle/W8RequiredToggle.test.jsx similarity index 92% rename from components/MintBounty/MintBountyModal/W8RequiredToggle/W8RequiredToggle.test.js rename to components/MintBounty/MintBountyModal/W8RequiredToggle/W8RequiredToggle.test.jsx index 44c408fdc..7a790bfd8 100644 --- a/components/MintBounty/MintBountyModal/W8RequiredToggle/W8RequiredToggle.test.js +++ b/components/MintBounty/MintBountyModal/W8RequiredToggle/W8RequiredToggle.test.jsx @@ -1,4 +1,4 @@ -/* @jest-environment jsdom +/* @vi-environment jsdom */ import React from 'react'; import { render, screen } from '../../../../test-utils'; @@ -10,7 +10,7 @@ describe('W8Required', () => { // Test cases for it('W8Required', async () => { const mintState = {}; - const mintDispatch = jest.fn(); + const mintDispatch = vi.fn(); // ARRANGE render( @@ -24,7 +24,7 @@ describe('W8Required', () => { }); it('W8Required', async () => { const mintState = {}; - const mintDispatch = jest.fn(); + const mintDispatch = vi.fn(); // ARRANGE const user = userEvent.setup(); render( diff --git a/components/MintBounty/MintBountyModal/W8RequiredToggle/index.js b/components/MintBounty/MintBountyModal/W8RequiredToggle/index.jsx similarity index 100% rename from components/MintBounty/MintBountyModal/W8RequiredToggle/index.js rename to components/MintBounty/MintBountyModal/W8RequiredToggle/index.jsx diff --git a/components/MintBounty/MintContext.js b/components/MintBounty/MintContext.jsx similarity index 100% rename from components/MintBounty/MintContext.js rename to components/MintBounty/MintContext.jsx diff --git a/components/MintBounty/MintProvider.js b/components/MintBounty/MintProvider.jsx similarity index 79% rename from components/MintBounty/MintProvider.js rename to components/MintBounty/MintProvider.jsx index 0042b6e6f..f0e3f516b 100644 --- a/components/MintBounty/MintProvider.js +++ b/components/MintBounty/MintProvider.jsx @@ -1,7 +1,7 @@ import React, { useReducer } from 'react'; -import MintReducer from './MintReducer.js'; +import MintReducer from './MintReducer'; import MintContext from './MintContext'; -import InitialState from './InitialMintState.js'; +import InitialState from './InitialMintState'; const MintProvider = ({ children, type }) => { const [state, dispatch] = useReducer(MintReducer, { type: parseInt(type), ...InitialState }); diff --git a/components/MintBounty/MintReducer.js b/components/MintBounty/MintReducer.jsx similarity index 100% rename from components/MintBounty/MintReducer.js rename to components/MintBounty/MintReducer.jsx diff --git a/components/Notifications/NotificationBell.js b/components/Notifications/NotificationBell.jsx similarity index 100% rename from components/Notifications/NotificationBell.js rename to components/Notifications/NotificationBell.jsx diff --git a/components/Organization/HackathonTab.js b/components/Organization/HackathonTab.jsx similarity index 100% rename from components/Organization/HackathonTab.js rename to components/Organization/HackathonTab.jsx diff --git a/__tests__/Organization/HorizontalOrganizationCard.test.js b/components/Organization/HorizontalOrganizationCard/HorizontalOrganizationCard.test.jsx similarity index 93% rename from __tests__/Organization/HorizontalOrganizationCard.test.js rename to components/Organization/HorizontalOrganizationCard/HorizontalOrganizationCard.test.jsx index 490e8feef..99e8a3440 100755 --- a/__tests__/Organization/HorizontalOrganizationCard.test.js +++ b/components/Organization/HorizontalOrganizationCard/HorizontalOrganizationCard.test.jsx @@ -1,10 +1,10 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import { render, screen } from '../../test-utils'; -import HorizontalOrganizationCard from '../../components/Organization/HorizontalOrganizationCard'; +import { render, screen } from '../../../test-utils'; +import HorizontalOrganizationCard from '.'; describe('HorizontalOrganizationCard', () => { const orgs = [ diff --git a/components/Organization/HorizontalOrganizationCard.js b/components/Organization/HorizontalOrganizationCard/index.jsx similarity index 96% rename from components/Organization/HorizontalOrganizationCard.js rename to components/Organization/HorizontalOrganizationCard/index.jsx index 7a4bdec90..dc2bbe959 100755 --- a/components/Organization/HorizontalOrganizationCard.js +++ b/components/Organization/HorizontalOrganizationCard/index.jsx @@ -2,9 +2,9 @@ import React, { useContext, useEffect, useState } from 'react'; import Image from 'next/image'; import Link from 'next/link'; -import StoreContext from '../../store/Store/StoreContext'; -import starOrganization from './starOrganization'; -import useWeb3 from '../../hooks/useWeb3'; +import StoreContext from '../../../store/Store/StoreContext'; +import starOrganization from '../starOrganization'; +import useWeb3 from '../../../hooks/useWeb3'; const HorizontalOrganizationCard = ({ organization }) => { const context = useContext(StoreContext); diff --git a/__tests__/Organization/OrganizationCard.test.js b/components/Organization/OrganizationCard/OrganizationCard.test.jsx similarity index 83% rename from __tests__/Organization/OrganizationCard.test.js rename to components/Organization/OrganizationCard/OrganizationCard.test.jsx index c041116b3..3f8dca08e 100755 --- a/__tests__/Organization/OrganizationCard.test.js +++ b/components/Organization/OrganizationCard/OrganizationCard.test.jsx @@ -1,11 +1,11 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import { render, screen } from '../../test-utils'; -import OrganizationCard from '../../components/Organization/OrganizationCard'; -import mocks from '../../__mocks__/mock-server.json'; +import { render, screen } from '../../../test-utils'; +import OrganizationCard from '.'; +import mocks from '../../../__mocks__/mock-server.json'; describe('OrganizationHomepage', () => { let mergedOrgs = mocks.organizations.map((org) => { diff --git a/components/Organization/OrganizationCard.js b/components/Organization/OrganizationCard/index.jsx similarity index 97% rename from components/Organization/OrganizationCard.js rename to components/Organization/OrganizationCard/index.jsx index c2714cb05..f4d5a6129 100755 --- a/components/Organization/OrganizationCard.js +++ b/components/Organization/OrganizationCard/index.jsx @@ -5,8 +5,8 @@ import Image from 'next/image'; import Skeleton from 'react-loading-skeleton'; // Custom -import StoreContext from '../../store/Store/StoreContext'; -import starOrganization from './starOrganization'; +import StoreContext from '../../../store/Store/StoreContext'; +import starOrganization from '../starOrganization'; const OrganizationCard = ({ organization, starringParent }) => { // Context diff --git a/__tests__/Organization/OrganizationContent.test.js b/components/Organization/OrganizationContent/OrganizationContent.test.jsx similarity index 91% rename from __tests__/Organization/OrganizationContent.test.js rename to components/Organization/OrganizationContent/OrganizationContent.test.jsx index fd7537092..ab47b0174 100755 --- a/__tests__/Organization/OrganizationContent.test.js +++ b/components/Organization/OrganizationContent/OrganizationContent.test.jsx @@ -1,12 +1,12 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import userEvent from '@testing-library/user-event'; -import { getReadyText, isOnlyContest } from '../../services/utils/lib'; +import { getReadyText, isOnlyContest } from '../../../services/utils/lib'; -import { render, screen } from '../../test-utils'; -import OrganizationContent from '../../components/Organization/OrganizationContent'; +import { render, screen } from '../../../test-utils'; +import OrganizationContent from '.'; import ShallowRenderer from 'react-test-renderer/shallow'; import nextRouter from 'next/router'; @@ -76,19 +76,19 @@ const repositories = [ describe('OrganizationContent', () => { beforeEach(() => { - const observe = jest.fn(); - const disconnect = jest.fn(); + const observe = vi.fn(); + const disconnect = vi.fn(); - nextRouter.useRouter = jest.fn(); + nextRouter.useRouter = vi.fn(); nextRouter.useRouter.mockImplementation(() => ({ query: { type: null }, - prefetch: jest.fn(() => { - return { catch: jest.fn }; + prefetch: vi.fn(() => { + return { catch: vi.fn }; }), })); - window.IntersectionObserver = jest.fn(() => ({ + window.IntersectionObserver = vi.fn(() => ({ observe, disconnect, })); diff --git a/__tests__/Organization/__snapshots__/OrganizationContent.test.js.snap b/components/Organization/OrganizationContent/__snapshots__/OrganizationContent.test.jsx.snap similarity index 88% rename from __tests__/Organization/__snapshots__/OrganizationContent.test.js.snap rename to components/Organization/OrganizationContent/__snapshots__/OrganizationContent.test.jsx.snap index ba18a291a..8460611b5 100644 --- a/__tests__/Organization/__snapshots__/OrganizationContent.test.js.snap +++ b/components/Organization/OrganizationContent/__snapshots__/OrganizationContent.test.jsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`OrganizationContent should render match DOM Snapshot 1`] = ` +exports[`OrganizationContent > should render match DOM Snapshot 1`] = `
@@ -68,8 +68,8 @@ exports[`OrganizationContent should render match DOM Snapshot 1`] = ` "body": "I am a little confused on how to find out how much it would cost to cancel a bid using the SDK. Current gwei price is arround 80 and opensea gives me a 30 USD transaction fee on medium when trying to cancel from their website. How do they calculate these fees? Any way to calculate the cost using their SDK before sending the orders in?", - "bodyHTML": "

I am a little confused on how to find out how much it would cost to cancel a bid using the SDK. Current gwei price is arround 80 and opensea gives me a 30 USD transaction fee on medium when trying to cancel from their website.

-

How do they calculate these fees? Any way to calculate the cost using their SDK before sending the orders in?

", + "bodyHTML": "

I am a little confused on how to find out how much it would cost to cancel a bid using the SDK. Current gwei price is arround 80 and opensea gives me a 30 USD transaction fee on medium when trying to cancel from their website.

+

How do they calculate these fees? Any way to calculate the cost using their SDK before sending the orders in?

", "bountyAddress": "0x033488800ae672726c34620d4bd817e1590d4cdc", "bountyClosedTime": null, "bountyId": "I_kwDOCHE8585AYvGo", diff --git a/components/Organization/OrganizationContent.js b/components/Organization/OrganizationContent/index.jsx similarity index 90% rename from components/Organization/OrganizationContent.js rename to components/Organization/OrganizationContent/index.jsx index 7d3d1d4aa..356b84b58 100755 --- a/components/Organization/OrganizationContent.js +++ b/components/Organization/OrganizationContent/index.jsx @@ -1,8 +1,8 @@ import React from 'react'; // Custom -import BountyList from '../BountyList'; -import RepoCard from './RepoCard'; +import BountyList from '../../BountyList'; +import RepoCard from '../RepoCard'; const OrganizationContent = ({ repositories, organizationData, paginationObj }) => { return ( diff --git a/components/Organization/OrganizationHeader.js b/components/Organization/OrganizationHeader.jsx similarity index 100% rename from components/Organization/OrganizationHeader.js rename to components/Organization/OrganizationHeader.jsx diff --git a/__tests__/Organization/OrganizationHeader.test.js b/components/Organization/OrganizationHeader.test.jsx similarity index 100% rename from __tests__/Organization/OrganizationHeader.test.js rename to components/Organization/OrganizationHeader.test.jsx diff --git a/components/Organization/OrganizationHomepage.js b/components/Organization/OrganizationHomepage.jsx similarity index 100% rename from components/Organization/OrganizationHomepage.js rename to components/Organization/OrganizationHomepage.jsx diff --git a/__tests__/Organization/OrganizationHomepage.test.js b/components/Organization/OrganizationHomepage.test.jsx similarity index 99% rename from __tests__/Organization/OrganizationHomepage.test.js rename to components/Organization/OrganizationHomepage.test.jsx index cd5863331..855011d3d 100755 --- a/__tests__/Organization/OrganizationHomepage.test.js +++ b/components/Organization/OrganizationHomepage.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; diff --git a/components/Organization/OrganizationMetadata.js b/components/Organization/OrganizationMetadata.jsx similarity index 100% rename from components/Organization/OrganizationMetadata.js rename to components/Organization/OrganizationMetadata.jsx diff --git a/__tests__/Organization/OrganizationMetadata.test.js b/components/Organization/OrganizationMetadata.test.jsx similarity index 95% rename from __tests__/Organization/OrganizationMetadata.test.js rename to components/Organization/OrganizationMetadata.test.jsx index 0ef7a9239..a1239c3ca 100755 --- a/__tests__/Organization/OrganizationMetadata.test.js +++ b/components/Organization/OrganizationMetadata.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import { waitFor } from '@testing-library/react'; @@ -9,6 +9,7 @@ import InitialState from '../../store/Store/InitialState'; import OrganizationMetadata from '../../components/Organization/OrganizationMetadata'; import mocks from '../../__mocks__/mock-server.json'; import renderer from 'react-test-renderer'; +import { cleanup } from '@testing-library/react'; describe('OrganizationMetadata', () => { let mergedOrgs = mocks.organizations.map((org) => { @@ -20,6 +21,9 @@ describe('OrganizationMetadata', () => { } return { ...org, ...currentGithubOrg }; }); + afterEach(() => { + cleanup(); + }); const test = (organization) => { const githubIds = organization.bountiesCreated.map((bounty) => bounty.bountyId); diff --git a/__tests__/Organization/RepoCard.test.js b/components/Organization/RepoCard/RepoCard.test.jsx similarity index 94% rename from __tests__/Organization/RepoCard.test.js rename to components/Organization/RepoCard/RepoCard.test.jsx index 7cb3a2b75..1a5cf5315 100755 --- a/__tests__/Organization/RepoCard.test.js +++ b/components/Organization/RepoCard/RepoCard.test.jsx @@ -1,10 +1,10 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import { render, screen } from '../../test-utils'; -import RepoCard from '../../components/Organization/RepoCard'; +import { render, screen } from '../../../test-utils'; +import RepoCard from '.'; import renderer from 'react-test-renderer'; describe('RepoCard', () => { diff --git a/__tests__/Organization/__snapshots__/RepoCard.test.js.snap b/components/Organization/RepoCard/__snapshots__/RepoCard.test.jsx.snap similarity index 91% rename from __tests__/Organization/__snapshots__/RepoCard.test.js.snap rename to components/Organization/RepoCard/__snapshots__/RepoCard.test.jsx.snap index eaa5763ef..0aca0f8eb 100644 --- a/__tests__/Organization/__snapshots__/RepoCard.test.js.snap +++ b/components/Organization/RepoCard/__snapshots__/RepoCard.test.jsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`RepoCard should show the Banner and match DOM Snapshot 1`] = ` +exports[`RepoCard > should show the Banner and match DOM Snapshot 1`] = `
diff --git a/components/Organization/RepoCard.js b/components/Organization/RepoCard/index.jsx similarity index 100% rename from components/Organization/RepoCard.js rename to components/Organization/RepoCard/index.jsx diff --git a/__tests__/Organization/__snapshots__/OrganizationHeader.test.js.snap b/components/Organization/__snapshots__/OrganizationHeader.test.jsx.snap similarity index 98% rename from __tests__/Organization/__snapshots__/OrganizationHeader.test.js.snap rename to components/Organization/__snapshots__/OrganizationHeader.test.jsx.snap index 8ff447ebf..885bd4efc 100644 --- a/__tests__/Organization/__snapshots__/OrganizationHeader.test.js.snap +++ b/components/Organization/__snapshots__/OrganizationHeader.test.jsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`OrganizationHeader should match DOM Snapshot 1`] = ` +exports[`OrganizationHeader > should match DOM Snapshot 1`] = `
diff --git a/__tests__/Organization/__snapshots__/OrganizationHomepage.test.js.snap b/components/Organization/__snapshots__/OrganizationHomepage.test.jsx.snap similarity index 99% rename from __tests__/Organization/__snapshots__/OrganizationHomepage.test.js.snap rename to components/Organization/__snapshots__/OrganizationHomepage.test.jsx.snap index d652ca042..f2382d724 100644 --- a/__tests__/Organization/__snapshots__/OrganizationHomepage.test.js.snap +++ b/components/Organization/__snapshots__/OrganizationHomepage.test.jsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`OrganizationHomepage should render match DOM Snapshot 1`] = ` +exports[`OrganizationHomepage > should render match DOM Snapshot 1`] = `
should match DOM Snapshot 1`] = `
    @@ -220,7 +220,7 @@ exports[`OrganizationMetadata should match DOM Snapshot 1`] = `
`; -exports[`OrganizationMetadata should match DOM Snapshot 2`] = ` +exports[`OrganizationMetadata > should match DOM Snapshot 2`] = `
    @@ -4055,7 +4055,7 @@ exports[`OrganizationMetadata should match DOM Snapshot 2`] = `
`; -exports[`OrganizationMetadata should match DOM Snapshot 3`] = ` +exports[`OrganizationMetadata > should match DOM Snapshot 3`] = `
    @@ -4097,7 +4097,7 @@ exports[`OrganizationMetadata should match DOM Snapshot 3`] = `
`; -exports[`OrganizationMetadata should match DOM Snapshot 4`] = ` +exports[`OrganizationMetadata > should match DOM Snapshot 4`] = `
    diff --git a/components/Organization/starOrganization.js b/components/Organization/starOrganization.jsx similarity index 100% rename from components/Organization/starOrganization.js rename to components/Organization/starOrganization.jsx diff --git a/__tests__/RefundBounty/ApprovalTransferModal.test.js b/components/RefundBounty/ApproveTransferModal/ApprovalTransferModal.test.jsx similarity index 96% rename from __tests__/RefundBounty/ApprovalTransferModal.test.js rename to components/RefundBounty/ApproveTransferModal/ApprovalTransferModal.test.jsx index 36efbde98..941a9ca7f 100755 --- a/__tests__/RefundBounty/ApprovalTransferModal.test.js +++ b/components/RefundBounty/ApproveTransferModal/ApprovalTransferModal.test.jsx @@ -1,17 +1,17 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import { render, screen } from '../../test-utils'; -import ApprovalTranferModal from '../../components/RefundBounty/ApproveTransferModal'; -import { CONFIRM, APPROVING, SUCCESS, ERROR } from '../../components/RefundBounty/ApproveTransferState'; -import InitialState from '../../store/Store/InitialState'; +import { render, screen } from '../../../test-utils'; +import ApprovalTranferModal from '.'; +import { CONFIRM, APPROVING, SUCCESS, ERROR } from '../ApproveTransferState'; +import InitialState from '../../../store/Store/InitialState'; const approveTransferStates = [CONFIRM, APPROVING, SUCCESS, ERROR]; function depositExpired(deposit) { return parseInt(deposit.receiveTime) + parseInt(deposit.expiration) < Math.floor(Date.now() / 1000); } -const currentDate = jest.getRealSystemTime(); +const currentDate = vi.getRealSystemTime(); const errors = [ { title: 'User Denied Transaction', diff --git a/components/RefundBounty/ApproveTransferModal.js b/components/RefundBounty/ApproveTransferModal/index.jsx similarity index 93% rename from components/RefundBounty/ApproveTransferModal.js rename to components/RefundBounty/ApproveTransferModal/index.jsx index 135b9c48a..0a730043b 100755 --- a/components/RefundBounty/ApproveTransferModal.js +++ b/components/RefundBounty/ApproveTransferModal/index.jsx @@ -2,17 +2,17 @@ import React, { useRef, useEffect, useContext, useState } from 'react'; // Custom -import { CONFIRM, APPROVING, SUCCESS, ERROR } from './ApproveTransferState'; -import LoadingIcon from '../Loading/ButtonLoadingIcon'; +import { CONFIRM, APPROVING, SUCCESS, ERROR } from '../ApproveTransferState'; +import LoadingIcon from '../../Loading/ButtonLoadingIcon'; import Link from 'next/link'; -import LinkText from '../svg/linktext'; -import ModalDefault from '../Utils/ModalDefault'; +import LinkText from '../../svg/linktext'; +import ModalDefault from '../../Utils/ModalDefault'; import Image from 'next/image'; -import CopyAddressToClipboard from '../CopyAddressToClipboard'; -import StoreContext from '../../store/Store/StoreContext'; +import CopyAddressToClipboard from '../../CopyAddressToClipboard'; +import StoreContext from '../../../store/Store/StoreContext'; import { ethers } from 'ethers'; -import TweetAbout from '../Utils/TweetAbout'; -import useEns from '../../hooks/useENS'; +import TweetAbout from '../../Utils/TweetAbout'; +import useEns from '../../../hooks/useENS'; const ApproveTransferModal = ({ approveTransferState, diff --git a/__tests__/RefundBounty/DepositCard.test.js b/components/RefundBounty/DepositCard/DepositCard.test.jsx similarity index 85% rename from __tests__/RefundBounty/DepositCard.test.js rename to components/RefundBounty/DepositCard/DepositCard.test.jsx index a65d8a8fc..e8fe039d5 100755 --- a/__tests__/RefundBounty/DepositCard.test.js +++ b/components/RefundBounty/DepositCard/DepositCard.test.jsx @@ -2,9 +2,9 @@ * @jest-environment jsdom */ import React from 'react'; -import { render, screen } from '../../test-utils'; -import DepositCard from '../../components/RefundBounty/DepositCard'; -import InitialState from '../../store/Store/InitialState'; +import { render, screen } from '../../../test-utils'; +import DepositCard from '.'; +import InitialState from '../../../store/Store/InitialState'; describe('DepositCard', () => { const deposits = [ @@ -13,7 +13,7 @@ describe('DepositCard', () => { refunded: false, receiveTime: '1662395968', tokenAddress: '0x0000000000000000000000000000000000000000', - expiration: '1', + expiration: '2592000', volume: '23000000000000000000', sender: { id: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', __typename: 'User' }, __typename: 'Deposit', @@ -21,7 +21,7 @@ describe('DepositCard', () => { { id: '0x8f5c1c912b8ffca325a22eadb33d6d54fa8e85b3752f2392eb54ecc6dd24b1e1', refunded: false, - receiveTime: '1662395948', + receiveTime: '1662395968', tokenAddress: '0x0000000000000000000000000000000000000000', expiration: '2592000', volume: '23000000000000000000', @@ -31,7 +31,7 @@ describe('DepositCard', () => { { id: '0x9c5e530511dff239da2c1c1205649aaa24fe2cc797d583a162744f26d623726a', refunded: false, - receiveTime: '1662395897', + receiveTime: '1662395968', tokenAddress: '0x0000000000000000000000000000000000000000', expiration: '2592000', volume: '23000000000000000000', @@ -43,29 +43,25 @@ describe('DepositCard', () => { refunded: true, receiveTime: '1662395968', tokenAddress: '0x0000000000000000000000000000000000000000', - expiration: '1', + expiration: '2592000', volume: '23000000000000000000', refundTime: '1662407371', sender: { id: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', __typename: 'User' }, __typename: 'Deposit', }, ]; - const isoDate = 1662396272728; - const RealDate = Date; - global.Date = class extends RealDate { - constructor() { - super(); - return new RealDate(isoDate); - } - }; beforeEach(() => { + const isoDate = 1662396270728; InitialState.openQClient.reset(); + const mockDate = new Date(isoDate); + vi.setSystemTime(mockDate); }); const test = (deposit) => { it('should render the volume and name of token', async () => { // ARRANGE + console.log(new Date()); render(); let heading = await screen.findByText(/23.00 MATIC/i); @@ -95,9 +91,11 @@ describe('DepositCard', () => { // ASSERT expect(nullish).toHaveLength(0); if (deposit.refunded) { - expect(screen.getByText(/Refunded on: September 5, 2022 at 16:44/)).toBeInTheDocument(); + expect(screen.getByText(/Refunded on:/)).toBeInTheDocument(); + expect(screen.getByText(/September 5, 2022 at 19:49/)).toBeInTheDocument(); } else { - expect(screen.getByText(/Refundable on: September 5, 2022 at 16:44/)).toBeInTheDocument(); + expect(screen.getByText(/Refundable on:/)).toBeInTheDocument(); + expect(screen.getByText(/October 5, 2022 at 16:39/)).toBeInTheDocument(); } }); @@ -121,10 +119,8 @@ describe('DepositCard', () => { // ARRANGE render(); const chgeNetworkBtn = await screen.findByRole('button', { name: /Network/i }); - // ASSERT expect(chgeNetworkBtn).toBeInTheDocument(); - const nullish = [...screen.queryAllByRole(/null/), ...screen.queryAllByRole(/undefined/)]; expect(nullish).toHaveLength(0); }); */ diff --git a/components/RefundBounty/DepositCard.js b/components/RefundBounty/DepositCard/index.jsx similarity index 95% rename from components/RefundBounty/DepositCard.js rename to components/RefundBounty/DepositCard/index.jsx index 9b0342bc3..db9b30a1e 100755 --- a/components/RefundBounty/DepositCard.js +++ b/components/RefundBounty/DepositCard/index.jsx @@ -1,10 +1,10 @@ // Third party import React, { useContext, useState, useEffect } from 'react'; -import StoreContext from '../../store/Store/StoreContext'; -import ToolTipNew from '../Utils/ToolTipNew'; +import StoreContext from '../../../store/Store/StoreContext'; +import ToolTipNew from '../../Utils/ToolTipNew'; import { ethers } from 'ethers'; -import ConnectButton from '../WalletConnect/ConnectButton'; -import TokenBalances from '../TokenBalances/TokenBalances'; +import ConnectButton from '../../WalletConnect/ConnectButton'; +import TokenBalances from '../../TokenBalances/TokenBalances'; const DepositCard = ({ deposit, diff --git a/__tests__/RefundBounty/Refund.test.js b/components/RefundBounty/RefundPage/Refund.test.jsx similarity index 96% rename from __tests__/RefundBounty/Refund.test.js rename to components/RefundBounty/RefundPage/Refund.test.jsx index 845f43168..8c1dcdd5e 100755 --- a/__tests__/RefundBounty/Refund.test.js +++ b/components/RefundBounty/RefundPage/Refund.test.jsx @@ -1,10 +1,10 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import { render, screen } from '../../test-utils'; -import RefundPage from '../../components/RefundBounty/RefundPage'; -import InitialState from '../../store/Store/InitialState'; +import { render, screen } from '../../../test-utils'; +import RefundPage from '.'; +import InitialState from '../../../store/Store/InitialState'; import userEvent from '@testing-library/user-event'; describe('RefundPage', () => { diff --git a/__tests__/RefundBounty/RefundPage.test.js b/components/RefundBounty/RefundPage/RefundPage.test.jsx similarity index 95% rename from __tests__/RefundBounty/RefundPage.test.js rename to components/RefundBounty/RefundPage/RefundPage.test.jsx index a1bd8a5c0..9de05578d 100755 --- a/__tests__/RefundBounty/RefundPage.test.js +++ b/components/RefundBounty/RefundPage/RefundPage.test.jsx @@ -1,10 +1,10 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import { render, screen } from '../../test-utils'; -import RefundPage from '../../components/RefundBounty/RefundPage'; -import InitialState from '../../store/Store/InitialState'; +import { render, screen } from '../../../test-utils'; +import RefundPage from '../RefundPage'; +import InitialState from '../../../store/Store/InitialState'; describe('RefundPage', () => { const bounty = { @@ -175,17 +175,15 @@ describe('RefundPage', () => { ], issuer: { id: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', __typename: 'User' }, }; - const isoDate = 1662396272728; - const RealDate = Date; - global.Date = class extends RealDate { - constructor() { - super(); - return new RealDate(isoDate); - } - }; beforeEach(() => { InitialState.openQClient.reset(); + + const isoDate = 1662396272728; + InitialState.openQClient.reset(); + const mockDate = new Date(isoDate); + vi.setSystemTime(mockDate); + InitialState.openQClient.reset(); }); const test = (bounty) => { @@ -221,7 +219,7 @@ describe('RefundPage', () => { const nullish = [...screen.queryAllByRole(/null/), ...screen.queryAllByRole(/undefined/)]; // ASSERT expect(nullish).toHaveLength(0); - expect(screen.getAllByText(/Refundable on: September 5, 2022 at 16:44/)).toHaveLength(3); + expect(screen.getAllByText(/Refundable on: September 5, 2022 at 16:39/)).toHaveLength(1); }); it('should render refunded', async () => { @@ -232,7 +230,7 @@ describe('RefundPage', () => { // ASSERT expect(heading).toBeInTheDocument(); // ASSERT - expect(screen.getAllByText(/Refunded on: September 5, 2022 at 16:44/)).toHaveLength(1); + expect(screen.getAllByText(/Refunded on: September 5, 2022 at 19:49/)).toHaveLength(1); const nullish = [...screen.queryAllByRole(/null/), ...screen.queryAllByRole(/undefined/)]; expect(nullish).toHaveLength(0); }); diff --git a/components/RefundBounty/RefundPage.js b/components/RefundBounty/RefundPage/index.jsx similarity index 96% rename from components/RefundBounty/RefundPage.js rename to components/RefundBounty/RefundPage/index.jsx index 210dca7e9..b3dc98d52 100755 --- a/components/RefundBounty/RefundPage.js +++ b/components/RefundBounty/RefundPage/index.jsx @@ -1,16 +1,16 @@ // Third party import React, { useState, useContext } from 'react'; -import useWeb3 from '../../hooks/useWeb3'; +import useWeb3 from '../../../hooks/useWeb3'; import { ethers } from 'ethers'; // Custom -import StoreContext from '../../store/Store/StoreContext'; -import DepositCard from './DepositCard'; -import ToolTipNew from '../Utils/ToolTipNew'; -import BountyClosed from '../BountyClosed'; -import ApproveTransferModal from './ApproveTransferModal'; -import { RESTING, CONFIRM, APPROVING, SUCCESS, ERROR } from './ApproveTransferState'; -import useIsOnCorrectNetwork from '../../hooks/useIsOnCorrectNetwork'; +import StoreContext from '../../../store/Store/StoreContext'; +import DepositCard from '../DepositCard'; +import ToolTipNew from '../../Utils/ToolTipNew'; +import BountyClosed from '../../BountyClosed'; +import ApproveTransferModal from '../ApproveTransferModal'; +import { RESTING, CONFIRM, APPROVING, SUCCESS, ERROR } from '../ApproveTransferState'; +import useIsOnCorrectNetwork from '../../../hooks/useIsOnCorrectNetwork'; const RefundPage = ({ bounty, refreshBounty, internalMenu }) => { const [error, setError] = useState(''); diff --git a/components/Requests/RequestIndividual/RequestIndividual.test.js b/components/Requests/RequestIndividual/RequestIndividual.test.jsx similarity index 89% rename from components/Requests/RequestIndividual/RequestIndividual.test.js rename to components/Requests/RequestIndividual/RequestIndividual.test.jsx index 693972959..4f07518a6 100644 --- a/components/Requests/RequestIndividual/RequestIndividual.test.js +++ b/components/Requests/RequestIndividual/RequestIndividual.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import { render, screen } from '../../../test-utils'; @@ -12,12 +12,12 @@ import MockOpenQClient from '../../../services/ethers/MockOpenQClient'; import MockOpenQPrismaClient from '../../../services/openq-api/MockOpenQPrismaClient'; InitialState.openQClient.shouldSleep = 200; -nextRouter.useRouter = jest.fn(); +nextRouter.useRouter = vi.fn(); nextRouter.useRouter.mockImplementation(() => ({ query: { type: null }, - prefetch: jest.fn(() => { - return { catch: jest.fn }; + prefetch: vi.fn(() => { + return { catch: vi.fn }; }), })); @@ -32,7 +32,7 @@ describe('ReqiestIndividual', () => { it('should allow to accept documents on chain', async () => { // ARRANGE const user = userEvent.setup(); - const setSupportingDocumentsComplete = jest.fn(); + const setSupportingDocumentsComplete = vi.fn(); render(, null, { ...InitialState, openQClient: new MockOpenQClient({ setSupportingDocumentsComplete }), @@ -48,7 +48,7 @@ describe('ReqiestIndividual', () => { // ARRANGE const user = userEvent.setup(); - const updateRequest = jest.fn(); + const updateRequest = vi.fn(); render(, null, { ...InitialState, openQPrismaClient: new MockOpenQPrismaClient({ updateRequest }), diff --git a/components/Requests/RequestIndividual/RequestIndividualState.js b/components/Requests/RequestIndividual/RequestIndividualState.jsx similarity index 100% rename from components/Requests/RequestIndividual/RequestIndividualState.js rename to components/Requests/RequestIndividual/RequestIndividualState.jsx diff --git a/components/Requests/RequestIndividual/index.js b/components/Requests/RequestIndividual/index.jsx similarity index 100% rename from components/Requests/RequestIndividual/index.js rename to components/Requests/RequestIndividual/index.jsx diff --git a/components/Requests/RequestIndividualCardLean.js b/components/Requests/RequestIndividualCardLean.jsx similarity index 100% rename from components/Requests/RequestIndividualCardLean.js rename to components/Requests/RequestIndividualCardLean.jsx diff --git a/components/Requests/RequestPage/RequestPage.test.js b/components/Requests/RequestPage/RequestPage.test.jsx similarity index 81% rename from components/Requests/RequestPage/RequestPage.test.js rename to components/Requests/RequestPage/RequestPage.test.jsx index e831aeffa..120d6bdb3 100644 --- a/components/Requests/RequestPage/RequestPage.test.js +++ b/components/Requests/RequestPage/RequestPage.test.jsx @@ -3,12 +3,12 @@ import React from 'react'; import RequestPage from '.'; import nextRouter from 'next/router'; -nextRouter.useRouter = jest.fn(); +nextRouter.useRouter = vi.fn(); nextRouter.useRouter.mockImplementation(() => ({ query: { type: null }, - prefetch: jest.fn(() => { - return { catch: jest.fn }; + prefetch: vi.fn(() => { + return { catch: vi.fn }; }), })); diff --git a/components/Requests/RequestPage/__snapshots__/RequestPage.test.js.snap b/components/Requests/RequestPage/__snapshots__/RequestPage.test.js.snap index c03f72995..21de74d8a 100644 --- a/components/Requests/RequestPage/__snapshots__/RequestPage.test.js.snap +++ b/components/Requests/RequestPage/__snapshots__/RequestPage.test.js.snap @@ -1,4 +1,4 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// vi Snapshot v1, https://goo.gl/fbAQLP exports[`RequestPage should match initial DOM Snapshot 1`] = ` diff --git a/components/Requests/RequestPage/__snapshots__/RequestPage.test.jsx.snap b/components/Requests/RequestPage/__snapshots__/RequestPage.test.jsx.snap new file mode 100644 index 000000000..b768c075c --- /dev/null +++ b/components/Requests/RequestPage/__snapshots__/RequestPage.test.jsx.snap @@ -0,0 +1,45 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`RequestPage > should match initial DOM Snapshot 1`] = ` + +
    +

    + Manage your bounties +

    +
    + You have received 0 requests. +
    +
    +
    +

    + Requests +

    +
    + If the submission requires changes, please "Decline" the form submission and write a message to the builder in the popup. Once the submission is completed correctly, please click "Accept". If you accept the request, the amount deposited in the contract will be unlocked for the builder. +
    + +
      +
      +
    +
    +
    +`; diff --git a/components/Requests/RequestPage/index.js b/components/Requests/RequestPage/index.jsx similarity index 95% rename from components/Requests/RequestPage/index.js rename to components/Requests/RequestPage/index.jsx index 05a5a3ae5..df984877d 100644 --- a/components/Requests/RequestPage/index.js +++ b/components/Requests/RequestPage/index.jsx @@ -1,13 +1,13 @@ import React, { useContext, useState } from 'react'; -import RequestIndividual from '../RequestIndividual/index.js'; +import RequestIndividual from '../RequestIndividual'; import { getPlural } from '../../../services/utils/lib'; import StoreContext from '../../../store/Store/StoreContext'; import AuthContext from '../../../store/AuthStore/AuthContext'; -import PaginatedList from '../../Utils/PaginatedList/index.js'; +import PaginatedList from '../../Utils/PaginatedList'; import { fetchRequestsWithServiceArg } from '../../../services/utils/lib'; import SearchBar from '../../Search/SearchBar'; import { useRouter } from 'next/router'; -import useWeb3 from '../../../hooks/useWeb3.js'; +import useWeb3 from '../../../hooks/useWeb3'; const RequestPage = ({ states }) => { const router = useRouter(); diff --git a/components/Search/SearchBar/SearchBar.test.js b/components/Search/SearchBar/SearchBar.test.jsx similarity index 85% rename from components/Search/SearchBar/SearchBar.test.js rename to components/Search/SearchBar/SearchBar.test.jsx index 6907a6dcc..c53cfed5f 100755 --- a/components/Search/SearchBar/SearchBar.test.js +++ b/components/Search/SearchBar/SearchBar.test.jsx @@ -1,12 +1,12 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import SearchBar from '.'; import renderer from 'react-test-renderer'; describe('SearchBar', () => { - const onKeyUp = jest.fn(); + const onKeyUp = vi.fn(); it('should match DOM Snapshot', () => { const tree = renderer.create(); expect(tree.toJSON()).toMatchSnapshot(); diff --git a/components/Search/SearchBar/__snapshots__/SearchBar.test.js.snap b/components/Search/SearchBar/__snapshots__/SearchBar.test.js.snap index aeacfde43..32cba99a4 100644 --- a/components/Search/SearchBar/__snapshots__/SearchBar.test.js.snap +++ b/components/Search/SearchBar/__snapshots__/SearchBar.test.js.snap @@ -1,4 +1,4 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// vi Snapshot v1, https://goo.gl/fbAQLP exports[`SearchBar should match DOM Snapshot 1`] = ` should match DOM Snapshot 1`] = ` + +`; diff --git a/components/Search/SearchBar/index.js b/components/Search/SearchBar/index.jsx similarity index 100% rename from components/Search/SearchBar/index.js rename to components/Search/SearchBar/index.jsx diff --git a/components/ShowCase/PrCard.js b/components/ShowCase/PrCard.jsx similarity index 100% rename from components/ShowCase/PrCard.js rename to components/ShowCase/PrCard.jsx diff --git a/components/ShowCase/ShowCaseCard.js b/components/ShowCase/ShowCaseCard.jsx similarity index 100% rename from components/ShowCase/ShowCaseCard.js rename to components/ShowCase/ShowCaseCard.jsx diff --git a/__tests__/Showcase/ShowCasePage.test.js b/components/ShowCase/ShowCasePage/ShowCasePage.test.jsx similarity index 85% rename from __tests__/Showcase/ShowCasePage.test.js rename to components/ShowCase/ShowCasePage/ShowCasePage.test.jsx index 67a87cdc8..6069cc374 100755 --- a/__tests__/Showcase/ShowCasePage.test.js +++ b/components/ShowCase/ShowCasePage/ShowCasePage.test.jsx @@ -1,10 +1,10 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import { render, screen, waitFor } from '../../test-utils'; -import ShowCasePage from '../../components/ShowCase/ShowCasePage'; +import { render, screen, waitFor } from '../../../test-utils'; +import ShowCasePage from '.'; describe('ShowcasePage', () => { const pr = { @@ -33,10 +33,10 @@ describe('ShowcasePage', () => { }; beforeEach(() => { - const observe = jest.fn(); - const disconnect = jest.fn(); + const observe = vi.fn(); + const disconnect = vi.fn(); - window.IntersectionObserver = jest.fn(() => ({ + window.IntersectionObserver = vi.fn(() => ({ observe, disconnect, })); diff --git a/components/ShowCase/ShowCasePage.js b/components/ShowCase/ShowCasePage/index.jsx similarity index 98% rename from components/ShowCase/ShowCasePage.js rename to components/ShowCase/ShowCasePage/index.jsx index 1ad5dba60..b855e1f8d 100755 --- a/components/ShowCase/ShowCasePage.js +++ b/components/ShowCase/ShowCasePage/index.jsx @@ -1,9 +1,9 @@ import React, { useState, useContext, useEffect } from 'react'; -import StoreContext from '../../store/Store/StoreContext'; +import StoreContext from '../../../store/Store/StoreContext'; import { ethers } from 'ethers'; import Image from 'next/image'; import Link from 'next/link'; -import AuthContext from '../../store/AuthStore/AuthContext'; +import AuthContext from '../../../store/AuthStore/AuthContext'; const ShowCasePage = ({ pr }) => { const [authState] = useContext(AuthContext); diff --git a/components/Stream/ApproveStreamModal.js b/components/Stream/ApproveStreamModal.jsx similarity index 100% rename from components/Stream/ApproveStreamModal.js rename to components/Stream/ApproveStreamModal.jsx diff --git a/components/Stream/ApproveTransferState.js b/components/Stream/ApproveTransferState.jsx similarity index 100% rename from components/Stream/ApproveTransferState.js rename to components/Stream/ApproveTransferState.jsx diff --git a/components/Stream/CreateStream.js b/components/Stream/CreateStream.jsx similarity index 100% rename from components/Stream/CreateStream.js rename to components/Stream/CreateStream.jsx diff --git a/components/Stream/FundStreamModal.js b/components/Stream/FundStreamModal.jsx similarity index 100% rename from components/Stream/FundStreamModal.js rename to components/Stream/FundStreamModal.jsx diff --git a/components/Stream/Stream.js b/components/Stream/Stream.jsx similarity index 100% rename from components/Stream/Stream.js rename to components/Stream/Stream.jsx diff --git a/components/Stream/ViewStream.js b/components/Stream/ViewStream.jsx similarity index 100% rename from components/Stream/ViewStream.js rename to components/Stream/ViewStream.jsx diff --git a/components/Submissions/SelectWinnerState.js b/components/Submissions/SelectWinnerState.jsx similarity index 100% rename from components/Submissions/SelectWinnerState.js rename to components/Submissions/SelectWinnerState.jsx diff --git a/__tests__/Submissions/__snapshots__/SubmissionCard.test.js.snap b/components/Submissions/SubmissionCard/SubmissionCard/__snapshots__/index.test.jsx.snap similarity index 96% rename from __tests__/Submissions/__snapshots__/SubmissionCard.test.js.snap rename to components/Submissions/SubmissionCard/SubmissionCard/__snapshots__/index.test.jsx.snap index 4e4321bf0..8abc064eb 100644 --- a/__tests__/Submissions/__snapshots__/SubmissionCard.test.js.snap +++ b/components/Submissions/SubmissionCard/SubmissionCard/__snapshots__/index.test.jsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`SubmissionCard should match DOM Snapshot 1`] = ` +exports[`SubmissionCard > should match DOM Snapshot 1`] = `
    - On undefined NaN, NaN at NaN:NaN + On March 28, 2022 at 17:57
    { const bounty = { ...Constants.bounty3, claims: [], payoutSchedule: Constants.payoutSchedule3 }; diff --git a/components/Submissions/SubmissionCard.js b/components/Submissions/SubmissionCard/index.jsx similarity index 94% rename from components/Submissions/SubmissionCard.js rename to components/Submissions/SubmissionCard/index.jsx index e71f8e9f2..d2e6b6e81 100755 --- a/components/Submissions/SubmissionCard.js +++ b/components/Submissions/SubmissionCard/index.jsx @@ -1,12 +1,12 @@ import React, { useContext } from 'react'; -import SubmissionCardAdmin from './SubmissionCardAdmin'; +import SubmissionCardAdmin from '../SubmissionCardAdmin'; import Link from 'next/link'; import Image from 'next/image'; import Skeleton from 'react-loading-skeleton'; -import SubmissionWinner from './SubmissionWinner'; -import useWeb3 from '../../hooks/useWeb3'; -import StoreContext from '../../store/Store/StoreContext'; -import WinnerSelectAmounts from './WinnerSelectAmounts'; +import SubmissionWinner from '../SubmissionWinner'; +import useWeb3 from '../../../hooks/useWeb3'; +import StoreContext from '../../../store/Store/StoreContext'; +import WinnerSelectAmounts from '../WinnerSelectAmounts'; const SubmissionCard = ({ pr, bounty, refreshBounty }) => { const [appState] = useContext(StoreContext); @@ -70,6 +70,7 @@ const SubmissionCard = ({ pr, bounty, refreshBounty }) => {
    {classifyTime(Date.now() / 1000 - prTime)}
    +
    On {appState.utils.formatDate(pr.createdAt)}
    diff --git a/__tests__/Submissions/SubmissionCardAdmin.test.js b/components/Submissions/SubmissionCardAdmin/SubmissionCardAdmin.test.jsx similarity index 79% rename from __tests__/Submissions/SubmissionCardAdmin.test.js rename to components/Submissions/SubmissionCardAdmin/SubmissionCardAdmin.test.jsx index e6372026c..6b5e42239 100755 --- a/__tests__/Submissions/SubmissionCardAdmin.test.js +++ b/components/Submissions/SubmissionCardAdmin/SubmissionCardAdmin.test.jsx @@ -1,11 +1,11 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import SubmissionCardAdmin from '../../components/Submissions/SubmissionCardAdmin'; +import SubmissionCardAdmin from '.'; import ShallowRenderer from 'react-test-renderer/shallow'; -import Constants from '../../test-utils/constant'; +import Constants from '../../../test-utils/constant'; describe('SubmissionCardAdmin', () => { const bounties = [ diff --git a/__tests__/Submissions/__snapshots__/SubmissionCardAdmin.test.js.snap b/components/Submissions/SubmissionCardAdmin/__snapshots__/SubmissionCardAdmin.test.jsx.snap similarity index 78% rename from __tests__/Submissions/__snapshots__/SubmissionCardAdmin.test.js.snap rename to components/Submissions/SubmissionCardAdmin/__snapshots__/SubmissionCardAdmin.test.jsx.snap index 0743b5fdb..18b72ba10 100644 --- a/__tests__/Submissions/__snapshots__/SubmissionCardAdmin.test.js.snap +++ b/components/Submissions/SubmissionCardAdmin/__snapshots__/SubmissionCardAdmin.test.jsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`SubmissionCardAdmin should render match DOM Snapshot 1`] = ` +exports[`SubmissionCardAdmin > should render match DOM Snapshot 1`] = `
    @@ -20,7 +20,7 @@ exports[`SubmissionCardAdmin should render match DOM Snapshot 1`] = ` "assignees": [], "avatarUrl": "https://avatars.githubusercontent.com/u/77402538?v=4", "body": "body of test2", - "bodyHTML": "

    body of test2

    ", + "bodyHTML": "

    body of test2

    ", "bountyAddress": "0x066efd87027a4cc4a21c57467f224ef98241d774", "bountyId": "I_kwDOGWnnz85I9Agl", "bountyMintTime": "1662545344", @@ -151,8 +151,9 @@ exports[`SubmissionCardAdmin should render match DOM Snapshot 1`] = ` }, }, "body": "This Closes #136 and also unrelated thing of Fixes #137", - "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", + "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", "bodyText": "This Closes #136 and also unrelated thing of Fixes #137", + "createdAt": "2022-03-28T17:57:44Z", "id": "PR_kwDOGWnnz841LGsK", "mergeCommit": { "__typename": "Commit", @@ -208,8 +209,9 @@ exports[`SubmissionCardAdmin should render match DOM Snapshot 1`] = ` }, }, "body": "This Closes #136 and also unrelated thing of Fixes #137", - "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", + "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", "bodyText": "This Closes #136 and also unrelated thing of Fixes #137", + "createdAt": "2022-03-28T17:57:44Z", "id": "PR_kwDOGWnnz841LGsK", "mergeCommit": { "__typename": "Commit", @@ -245,7 +247,7 @@ exports[`SubmissionCardAdmin should render match DOM Snapshot 1`] = ` "assignees": [], "avatarUrl": "https://avatars.githubusercontent.com/u/77402538?v=4", "body": "body of test2", - "bodyHTML": "

    body of test2

    ", + "bodyHTML": "

    body of test2

    ", "bountyAddress": "0x066efd87027a4cc4a21c57467f224ef98241d774", "bountyId": "I_kwDOGWnnz85I9Agl", "bountyMintTime": "1662545344", @@ -376,8 +378,9 @@ exports[`SubmissionCardAdmin should render match DOM Snapshot 1`] = ` }, }, "body": "This Closes #136 and also unrelated thing of Fixes #137", - "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", + "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", "bodyText": "This Closes #136 and also unrelated thing of Fixes #137", + "createdAt": "2022-03-28T17:57:44Z", "id": "PR_kwDOGWnnz841LGsK", "mergeCommit": { "__typename": "Commit", @@ -433,8 +436,9 @@ exports[`SubmissionCardAdmin should render match DOM Snapshot 1`] = ` }, }, "body": "This Closes #136 and also unrelated thing of Fixes #137", - "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", + "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", "bodyText": "This Closes #136 and also unrelated thing of Fixes #137", + "createdAt": "2022-03-28T17:57:44Z", "id": "PR_kwDOGWnnz841LGsK", "mergeCommit": { "__typename": "Commit", @@ -470,7 +474,7 @@ exports[`SubmissionCardAdmin should render match DOM Snapshot 1`] = ` "assignees": [], "avatarUrl": "https://avatars.githubusercontent.com/u/77402538?v=4", "body": "body of test2", - "bodyHTML": "

    body of test2

    ", + "bodyHTML": "

    body of test2

    ", "bountyAddress": "0x066efd87027a4cc4a21c57467f224ef98241d774", "bountyId": "I_kwDOGWnnz85I9Agl", "bountyMintTime": "1662545344", @@ -601,8 +605,9 @@ exports[`SubmissionCardAdmin should render match DOM Snapshot 1`] = ` }, }, "body": "This Closes #136 and also unrelated thing of Fixes #137", - "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", + "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", "bodyText": "This Closes #136 and also unrelated thing of Fixes #137", + "createdAt": "2022-03-28T17:57:44Z", "id": "PR_kwDOGWnnz841LGsK", "mergeCommit": { "__typename": "Commit", @@ -658,8 +663,9 @@ exports[`SubmissionCardAdmin should render match DOM Snapshot 1`] = ` }, }, "body": "This Closes #136 and also unrelated thing of Fixes #137", - "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", + "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", "bodyText": "This Closes #136 and also unrelated thing of Fixes #137", + "createdAt": "2022-03-28T17:57:44Z", "id": "PR_kwDOGWnnz841LGsK", "mergeCommit": { "__typename": "Commit", @@ -693,7 +699,7 @@ exports[`SubmissionCardAdmin should render match DOM Snapshot 1`] = `
    `; -exports[`SubmissionCardAdmin should render match DOM Snapshot 2`] = ` +exports[`SubmissionCardAdmin > should render match DOM Snapshot 2`] = `
    @@ -713,7 +719,7 @@ exports[`SubmissionCardAdmin should render match DOM Snapshot 2`] = ` "assignees": [], "avatarUrl": "https://avatars.githubusercontent.com/u/77402538?v=4", "body": "body of test2", - "bodyHTML": "

    body of test2

    ", + "bodyHTML": "

    body of test2

    ", "bountyAddress": "0x066efd87027a4cc4a21c57467f224ef98241d774", "bountyId": "I_kwDOGWnnz85I9Agl", "bountyMintTime": "1662545344", @@ -845,8 +851,9 @@ exports[`SubmissionCardAdmin should render match DOM Snapshot 2`] = ` }, }, "body": "This Closes #136 and also unrelated thing of Fixes #137", - "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", + "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", "bodyText": "This Closes #136 and also unrelated thing of Fixes #137", + "createdAt": "2022-03-28T17:57:44Z", "id": "PR_kwDOGWnnz841LGsK", "mergeCommit": { "__typename": "Commit", @@ -913,8 +920,9 @@ exports[`SubmissionCardAdmin should render match DOM Snapshot 2`] = ` }, }, "body": "This Closes #136 and also unrelated thing of Fixes #137", - "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", + "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", "bodyText": "This Closes #136 and also unrelated thing of Fixes #137", + "createdAt": "2022-03-28T17:57:44Z", "id": "PR_kwDOGWnnz841LGsK", "mergeCommit": { "__typename": "Commit", @@ -950,7 +958,7 @@ exports[`SubmissionCardAdmin should render match DOM Snapshot 2`] = ` "assignees": [], "avatarUrl": "https://avatars.githubusercontent.com/u/77402538?v=4", "body": "body of test2", - "bodyHTML": "

    body of test2

    ", + "bodyHTML": "

    body of test2

    ", "bountyAddress": "0x066efd87027a4cc4a21c57467f224ef98241d774", "bountyId": "I_kwDOGWnnz85I9Agl", "bountyMintTime": "1662545344", @@ -1082,8 +1090,9 @@ exports[`SubmissionCardAdmin should render match DOM Snapshot 2`] = ` }, }, "body": "This Closes #136 and also unrelated thing of Fixes #137", - "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", + "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", "bodyText": "This Closes #136 and also unrelated thing of Fixes #137", + "createdAt": "2022-03-28T17:57:44Z", "id": "PR_kwDOGWnnz841LGsK", "mergeCommit": { "__typename": "Commit", @@ -1150,8 +1159,9 @@ exports[`SubmissionCardAdmin should render match DOM Snapshot 2`] = ` }, }, "body": "This Closes #136 and also unrelated thing of Fixes #137", - "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", + "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", "bodyText": "This Closes #136 and also unrelated thing of Fixes #137", + "createdAt": "2022-03-28T17:57:44Z", "id": "PR_kwDOGWnnz841LGsK", "mergeCommit": { "__typename": "Commit", @@ -1187,7 +1197,7 @@ exports[`SubmissionCardAdmin should render match DOM Snapshot 2`] = ` "assignees": [], "avatarUrl": "https://avatars.githubusercontent.com/u/77402538?v=4", "body": "body of test2", - "bodyHTML": "

    body of test2

    ", + "bodyHTML": "

    body of test2

    ", "bountyAddress": "0x066efd87027a4cc4a21c57467f224ef98241d774", "bountyId": "I_kwDOGWnnz85I9Agl", "bountyMintTime": "1662545344", @@ -1319,8 +1329,9 @@ exports[`SubmissionCardAdmin should render match DOM Snapshot 2`] = ` }, }, "body": "This Closes #136 and also unrelated thing of Fixes #137", - "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", + "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", "bodyText": "This Closes #136 and also unrelated thing of Fixes #137", + "createdAt": "2022-03-28T17:57:44Z", "id": "PR_kwDOGWnnz841LGsK", "mergeCommit": { "__typename": "Commit", @@ -1387,8 +1398,9 @@ exports[`SubmissionCardAdmin should render match DOM Snapshot 2`] = ` }, }, "body": "This Closes #136 and also unrelated thing of Fixes #137", - "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", + "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", "bodyText": "This Closes #136 and also unrelated thing of Fixes #137", + "createdAt": "2022-03-28T17:57:44Z", "id": "PR_kwDOGWnnz841LGsK", "mergeCommit": { "__typename": "Commit", diff --git a/components/Submissions/SubmissionCardAdmin.js b/components/Submissions/SubmissionCardAdmin/index.jsx similarity index 95% rename from components/Submissions/SubmissionCardAdmin.js rename to components/Submissions/SubmissionCardAdmin/index.jsx index 3d81f866d..7c40c07e8 100755 --- a/components/Submissions/SubmissionCardAdmin.js +++ b/components/Submissions/SubmissionCardAdmin/index.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import WinnerSelectAmounts from './WinnerSelectAmounts'; +import WinnerSelectAmounts from '../WinnerSelectAmounts'; const SubmissionCardAdmin = ({ bounty, pr, refreshBounty }) => { const claimedArr = bounty.claims?.map((claim) => parseInt(claim.tier)); diff --git a/components/Submissions/SubmissionWinner.js b/components/Submissions/SubmissionWinner/index.jsx similarity index 95% rename from components/Submissions/SubmissionWinner.js rename to components/Submissions/SubmissionWinner/index.jsx index 46bded4b1..0b9ae5f9e 100644 --- a/components/Submissions/SubmissionWinner.js +++ b/components/Submissions/SubmissionWinner/index.jsx @@ -1,6 +1,6 @@ import React, { useContext } from 'react'; -import StoreContext from '../../store/Store/StoreContext'; -import { formatVolume } from '../../services/utils/lib'; +import StoreContext from '../../../store/Store/StoreContext'; +import { formatVolume } from '../../../services/utils/lib'; const SubmissionWinner = ({ linkedPrize, bounty }) => { const [appState] = useContext(StoreContext); diff --git a/__tests__/Submissions/Submissions.test.js b/components/Submissions/Submissions/Submissions.test.jsx similarity index 74% rename from __tests__/Submissions/Submissions.test.js rename to components/Submissions/Submissions/Submissions.test.jsx index ae2d0b3a9..7be0900b2 100755 --- a/__tests__/Submissions/Submissions.test.js +++ b/components/Submissions/Submissions/Submissions.test.jsx @@ -1,11 +1,11 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import Submissions from '../../components/Submissions/Submissions'; +import Submissions from '.'; import ShallowRenderer from 'react-test-renderer/shallow'; -import Constants from '../../test-utils/constant'; +import Constants from '../../../test-utils/constant'; describe('Submissions', () => { const bounty = Constants.bounty; diff --git a/__tests__/Submissions/__snapshots__/Submissions.test.js.snap b/components/Submissions/Submissions/__snapshots__/Submissions.test.jsx.snap similarity index 77% rename from __tests__/Submissions/__snapshots__/Submissions.test.js.snap rename to components/Submissions/Submissions/__snapshots__/Submissions.test.jsx.snap index 0d78d8650..40c9e16c7 100644 --- a/__tests__/Submissions/__snapshots__/Submissions.test.js.snap +++ b/components/Submissions/Submissions/__snapshots__/Submissions.test.jsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Submissions should render match DOM Snapshot 1`] = ` +exports[`Submissions > should render match DOM Snapshot 1`] = `
    body of test2

    ", + "bodyHTML": "

    body of test2

    ", "bountyAddress": "0x066efd87027a4cc4a21c57467f224ef98241d774", "bountyId": "I_kwDOGWnnz85I9Agl", "bountyMintTime": "1662545344", @@ -143,8 +143,9 @@ exports[`Submissions should render match DOM Snapshot 1`] = ` }, }, "body": "This Closes #136 and also unrelated thing of Fixes #137", - "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", + "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", "bodyText": "This Closes #136 and also unrelated thing of Fixes #137", + "createdAt": "2022-03-28T17:57:44Z", "id": "PR_kwDOGWnnz841LGsK", "mergeCommit": { "__typename": "Commit", @@ -200,8 +201,9 @@ exports[`Submissions should render match DOM Snapshot 1`] = ` }, }, "body": "This Closes #136 and also unrelated thing of Fixes #137", - "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", + "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", "bodyText": "This Closes #136 and also unrelated thing of Fixes #137", + "createdAt": "2022-03-28T17:57:44Z", "id": "PR_kwDOGWnnz841LGsK", "mergeCommit": { "__typename": "Commit", diff --git a/components/Submissions/Submissions.js b/components/Submissions/Submissions/index.jsx similarity index 95% rename from components/Submissions/Submissions.js rename to components/Submissions/Submissions/index.jsx index 3405d4ced..ed608325d 100755 --- a/components/Submissions/Submissions.js +++ b/components/Submissions/Submissions/index.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import SubmissionCard from './SubmissionCard'; +import SubmissionCard from '../SubmissionCard'; const Submissions = ({ bounty, refreshBounty }) => { const prs = bounty.prs; diff --git a/__tests__/Submissions/WinnerSelect.test.js b/components/Submissions/WinnerSelectAmounts/WinnerSelectAmounts.test.jsx similarity index 95% rename from __tests__/Submissions/WinnerSelect.test.js rename to components/Submissions/WinnerSelectAmounts/WinnerSelectAmounts.test.jsx index af53f9dcf..1aadae955 100755 --- a/__tests__/Submissions/WinnerSelect.test.js +++ b/components/Submissions/WinnerSelectAmounts/WinnerSelectAmounts.test.jsx @@ -1,10 +1,10 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import { render, screen } from '../../test-utils'; -import WinnerSelectAmounts from '../../components/Submissions/WinnerSelectAmounts'; +import { render, screen } from '../../../test-utils'; +import WinnerSelectAmounts from '.'; import userEvent from '@testing-library/user-event'; describe('WinnerSelect', () => { @@ -156,10 +156,10 @@ describe('WinnerSelect', () => { }; beforeEach(() => { - const observe = jest.fn(); - const disconnect = jest.fn(); + const observe = vi.fn(); + const disconnect = vi.fn(); - window.IntersectionObserver = jest.fn(() => ({ + window.IntersectionObserver = vi.fn(() => ({ observe, disconnect, })); diff --git a/components/Submissions/WinnerSelectAmounts.js b/components/Submissions/WinnerSelectAmounts/index.jsx similarity index 95% rename from components/Submissions/WinnerSelectAmounts.js rename to components/Submissions/WinnerSelectAmounts/index.jsx index 59727950a..a7bcb331d 100644 --- a/components/Submissions/WinnerSelectAmounts.js +++ b/components/Submissions/WinnerSelectAmounts/index.jsx @@ -1,14 +1,14 @@ import React, { useContext, useState, useMemo } from 'react'; -import useWeb3 from '../../hooks/useWeb3'; -import StoreContext from '../../store/Store/StoreContext'; -import LoadingIcon from '../Loading/ButtonLoadingIcon'; -import { RESTING, CONFIRM, TRANSFERRING, SUCCESS, ERROR } from './SelectWinnerState'; -import ToolTip from '../Utils/ToolTipNew'; -import ModalDefault from '../Utils/ModalDefault'; +import useWeb3 from '../../../hooks/useWeb3'; +import StoreContext from '../../../store/Store/StoreContext'; +import LoadingIcon from '../../Loading/ButtonLoadingIcon'; +import { RESTING, CONFIRM, TRANSFERRING, SUCCESS, ERROR } from '../SelectWinnerState'; +import ToolTip from '../../Utils/ToolTipNew'; +import ModalDefault from '../../Utils/ModalDefault'; import { ethers } from 'ethers'; -import useGetTokenValues from '../../hooks/useGetTokenValues'; -import { formatVolume } from '../../services/utils/lib'; -import GnosisWarning from '../Utils/GnosisWarning'; +import useGetTokenValues from '../../../hooks/useGetTokenValues'; +import { formatVolume } from '../../../services/utils/lib'; +import GnosisWarning from '../../Utils/GnosisWarning'; const WinnerSelectAmounts = ({ prize, bounty, refreshBounty, pr, disabled, isRemove, tierClaimed }) => { const [showModal, setShowModal] = useState(); diff --git a/__tests__/TokenBalances/TokenBalances.test.js b/components/TokenBalances/TokenBalances/TokenBalances.test.jsx similarity index 89% rename from __tests__/TokenBalances/TokenBalances.test.js rename to components/TokenBalances/TokenBalances/TokenBalances.test.jsx index 6b301e11b..5b66bc7c3 100755 --- a/__tests__/TokenBalances/TokenBalances.test.js +++ b/components/TokenBalances/TokenBalances/TokenBalances.test.jsx @@ -1,6 +1,6 @@ // test/pages/index.test.js /** - * @jest-environment jsdom + * @vi-environment jsdom */ /* @@ -16,8 +16,8 @@ */ import React from 'react'; -import { render, screen } from '../../test-utils'; -import TokenBalances from '../../components/TokenBalances/TokenBalances'; +import { render, screen } from '../../../test-utils'; +import TokenBalances from '.'; // Test cases for full balances, empty balances, and undefined balances. const tokenBalances = [ diff --git a/__tests__/TokenBalances/__snapshots__/TokenDisplay.test.js.snap b/components/TokenBalances/TokenBalances/__snapshots__/TokenDisplay.test.js.snap similarity index 96% rename from __tests__/TokenBalances/__snapshots__/TokenDisplay.test.js.snap rename to components/TokenBalances/TokenBalances/__snapshots__/TokenDisplay.test.js.snap index de18656d5..4b34be38e 100644 --- a/__tests__/TokenBalances/__snapshots__/TokenDisplay.test.js.snap +++ b/components/TokenBalances/TokenBalances/__snapshots__/TokenDisplay.test.js.snap @@ -1,4 +1,4 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// vi Snapshot v1, https://goo.gl/fbAQLP exports[`TokenDisplay should match DOM Snapshot 1`] = ` +`; diff --git a/components/TokenBalances/TokenDisplay.js b/components/TokenBalances/TokenDisplay/index.jsx similarity index 100% rename from components/TokenBalances/TokenDisplay.js rename to components/TokenBalances/TokenDisplay/index.jsx diff --git a/components/TokenSelection/DepositPeriod/index.js b/components/TokenSelection/DepositPeriod/index.jsx similarity index 100% rename from components/TokenSelection/DepositPeriod/index.js rename to components/TokenSelection/DepositPeriod/index.jsx diff --git a/components/TokenSelection/ManageTokenList/ManageTokenList.test.js b/components/TokenSelection/ManageTokenList/ManageTokenList.test.jsx similarity index 95% rename from components/TokenSelection/ManageTokenList/ManageTokenList.test.js rename to components/TokenSelection/ManageTokenList/ManageTokenList.test.jsx index 90539392b..19f244d76 100755 --- a/components/TokenSelection/ManageTokenList/ManageTokenList.test.js +++ b/components/TokenSelection/ManageTokenList/ManageTokenList.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import userEvent from '@testing-library/user-event'; @@ -11,8 +11,8 @@ describe('ManageTokenList', () => { const test = () => { let setLists, setCustomTokens; beforeEach(() => { - setLists = jest.fn(); - setCustomTokens = jest.fn(); + setLists = vi.fn(); + setCustomTokens = vi.fn(); }); it('should render ManageTokenList', () => { // ARRANGE diff --git a/components/TokenSelection/ManageTokenList/index.js b/components/TokenSelection/ManageTokenList/index.jsx similarity index 100% rename from components/TokenSelection/ManageTokenList/index.js rename to components/TokenSelection/ManageTokenList/index.jsx diff --git a/components/TokenSelection/NFTFundModal/index.js b/components/TokenSelection/NFTFundModal/index.jsx similarity index 100% rename from components/TokenSelection/NFTFundModal/index.js rename to components/TokenSelection/NFTFundModal/index.jsx diff --git a/components/TokenSelection/SelectableNFT/index.js b/components/TokenSelection/SelectableNFT/index.jsx similarity index 100% rename from components/TokenSelection/SelectableNFT/index.js rename to components/TokenSelection/SelectableNFT/index.jsx diff --git a/components/TokenSelection/SelectedTokenImg/index.js b/components/TokenSelection/SelectedTokenImg/index.jsx similarity index 100% rename from components/TokenSelection/SelectedTokenImg/index.js rename to components/TokenSelection/SelectedTokenImg/index.jsx diff --git a/components/TokenSelection/TokenFundBox/TokenFundBox.test.js b/components/TokenSelection/TokenFundBox/TokenFundBox.test.jsx similarity index 94% rename from components/TokenSelection/TokenFundBox/TokenFundBox.test.js rename to components/TokenSelection/TokenFundBox/TokenFundBox.test.jsx index 103e7c8bb..2b8acf920 100755 --- a/components/TokenSelection/TokenFundBox/TokenFundBox.test.js +++ b/components/TokenSelection/TokenFundBox/TokenFundBox.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import TokenFundBox from '.'; diff --git a/components/TokenSelection/TokenFundBox/__snapshots__/TokenFundBox.test.js.snap b/components/TokenSelection/TokenFundBox/__snapshots__/TokenFundBox.test.js.snap index 1d61f42b1..d508183d0 100644 --- a/components/TokenSelection/TokenFundBox/__snapshots__/TokenFundBox.test.js.snap +++ b/components/TokenSelection/TokenFundBox/__snapshots__/TokenFundBox.test.js.snap @@ -1,4 +1,4 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// vi Snapshot v1, https://goo.gl/fbAQLP exports[`TokenFundBox should match DOM Snapshot 1`] = `
    should match DOM Snapshot 1`] = ` +
    +
    +
    + +
    +
    +
    + +
    +
    +`; diff --git a/components/TokenSelection/TokenFundBox/index.js b/components/TokenSelection/TokenFundBox/index.jsx similarity index 100% rename from components/TokenSelection/TokenFundBox/index.js rename to components/TokenSelection/TokenFundBox/index.jsx diff --git a/components/TokenSelection/TokenList/TokenList.test.js b/components/TokenSelection/TokenList/TokenList.test.jsx similarity index 87% rename from components/TokenSelection/TokenList/TokenList.test.js rename to components/TokenSelection/TokenList/TokenList.test.jsx index e5c858d2e..cf9bd5ef9 100755 --- a/components/TokenSelection/TokenList/TokenList.test.js +++ b/components/TokenSelection/TokenList/TokenList.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; import { render, screen } from '../../../test-utils'; @@ -8,9 +8,9 @@ import openqDefaultTokens from '../../../constants/openq-local-enumerable.json'; import polygonDefaultTokens from '../../../constants/openq-polygon-mainnet-enumerable.json'; beforeEach(() => { - const observe = jest.fn(); - const disconnect = jest.fn(); - window.IntersectionObserver = jest.fn(() => ({ + const observe = vi.fn(); + const disconnect = vi.fn(); + window.IntersectionObserver = vi.fn(() => ({ observe, disconnect, })); diff --git a/components/TokenSelection/TokenList/index.js b/components/TokenSelection/TokenList/index.jsx similarity index 100% rename from components/TokenSelection/TokenList/index.js rename to components/TokenSelection/TokenList/index.jsx diff --git a/components/TokenSelection/TokenSearch/index.js b/components/TokenSelection/TokenSearch/index.jsx similarity index 100% rename from components/TokenSelection/TokenSearch/index.js rename to components/TokenSelection/TokenSearch/index.jsx diff --git a/components/TokenSelection/TokenStats/TokenStats.test.js b/components/TokenSelection/TokenStats/TokenStats.test.jsx similarity index 100% rename from components/TokenSelection/TokenStats/TokenStats.test.js rename to components/TokenSelection/TokenStats/TokenStats.test.jsx diff --git a/components/TokenSelection/TokenStats/__snapshots__/TokenStats.test.js.snap b/components/TokenSelection/TokenStats/__snapshots__/TokenStats.test.js.snap index 382a1ddd9..a0f8d1bea 100644 --- a/components/TokenSelection/TokenStats/__snapshots__/TokenStats.test.js.snap +++ b/components/TokenSelection/TokenStats/__snapshots__/TokenStats.test.js.snap @@ -1,4 +1,4 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// vi Snapshot v1, https://goo.gl/fbAQLP exports[`TokenStats should match DOM Snapshot 1`] = ` [ diff --git a/components/TokenSelection/TokenStats/__snapshots__/TokenStats.test.jsx.snap b/components/TokenSelection/TokenStats/__snapshots__/TokenStats.test.jsx.snap new file mode 100644 index 000000000..fabde04bb --- /dev/null +++ b/components/TokenSelection/TokenStats/__snapshots__/TokenStats.test.jsx.snap @@ -0,0 +1,29 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`TokenStats > should match DOM Snapshot 1`] = ` +[ + crypto-logo, + + 2.8 + + DAI + , +] +`; diff --git a/components/TokenSelection/TokenStats/index.js b/components/TokenSelection/TokenStats/index.jsx similarity index 100% rename from components/TokenSelection/TokenStats/index.js rename to components/TokenSelection/TokenStats/index.jsx diff --git a/components/TokenSelection/TokenStore/ApproveFundState.js b/components/TokenSelection/TokenStore/ApproveFundState.jsx similarity index 100% rename from components/TokenSelection/TokenStore/ApproveFundState.js rename to components/TokenSelection/TokenStore/ApproveFundState.jsx diff --git a/components/TokenSelection/TokenStore/InitialTokenState.js b/components/TokenSelection/TokenStore/InitialTokenState.jsx similarity index 100% rename from components/TokenSelection/TokenStore/InitialTokenState.js rename to components/TokenSelection/TokenStore/InitialTokenState.jsx diff --git a/components/FundBounty/FundStore/TestFundProvider.js b/components/TokenSelection/TokenStore/TestTokenProvider.jsx similarity index 100% rename from components/FundBounty/FundStore/TestFundProvider.js rename to components/TokenSelection/TokenStore/TestTokenProvider.jsx diff --git a/components/TokenSelection/TokenStore/TokenContext.js b/components/TokenSelection/TokenStore/TokenContext.jsx similarity index 100% rename from components/TokenSelection/TokenStore/TokenContext.js rename to components/TokenSelection/TokenStore/TokenContext.jsx diff --git a/components/TokenSelection/TokenStore/TokenProvider.js b/components/TokenSelection/TokenStore/TokenProvider.jsx similarity index 100% rename from components/TokenSelection/TokenStore/TokenProvider.js rename to components/TokenSelection/TokenStore/TokenProvider.jsx diff --git a/components/TokenSelection/TokenStore/TokenReducer.js b/components/TokenSelection/TokenStore/TokenReducer.jsx similarity index 100% rename from components/TokenSelection/TokenStore/TokenReducer.js rename to components/TokenSelection/TokenStore/TokenReducer.jsx diff --git a/components/User/AboutFreelancer.js b/components/User/AboutFreelancer.jsx similarity index 100% rename from components/User/AboutFreelancer.js rename to components/User/AboutFreelancer.jsx diff --git a/components/User/GithubRegistration/AssociateAddress.js b/components/User/GithubRegistration/AssociateAddress.jsx similarity index 100% rename from components/User/GithubRegistration/AssociateAddress.js rename to components/User/GithubRegistration/AssociateAddress.jsx diff --git a/components/User/GithubRegistration/AssociateModal.js b/components/User/GithubRegistration/AssociateModal.jsx similarity index 100% rename from components/User/GithubRegistration/AssociateModal.js rename to components/User/GithubRegistration/AssociateModal.jsx diff --git a/components/User/InvoicingDetailsTab/FreelancerDetails.js b/components/User/InvoicingDetailsTab/FreelancerDetails.jsx similarity index 100% rename from components/User/InvoicingDetailsTab/FreelancerDetails.js rename to components/User/InvoicingDetailsTab/FreelancerDetails.jsx diff --git a/components/User/InvoicingDetailsTab/OrgDetails.js b/components/User/InvoicingDetailsTab/OrgDetails.jsx similarity index 100% rename from components/User/InvoicingDetailsTab/OrgDetails.js rename to components/User/InvoicingDetailsTab/OrgDetails.jsx diff --git a/components/User/InvoicingDetailsTab/StyledInput.js b/components/User/InvoicingDetailsTab/StyledInput.jsx similarity index 100% rename from components/User/InvoicingDetailsTab/StyledInput.js rename to components/User/InvoicingDetailsTab/StyledInput.jsx diff --git a/__tests__/User/AboutModules/OverviewTab/AboutTitle.test.js b/components/User/OverviewTab/AboutTitle/AboutTitle.test.jsx similarity index 81% rename from __tests__/User/AboutModules/OverviewTab/AboutTitle.test.js rename to components/User/OverviewTab/AboutTitle/AboutTitle.test.jsx index 274ebd3fd..633cd43ec 100755 --- a/__tests__/User/AboutModules/OverviewTab/AboutTitle.test.js +++ b/components/User/OverviewTab/AboutTitle/AboutTitle.test.jsx @@ -1,9 +1,9 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import AboutTitle from '../../../../components/User/OverviewTab/AboutTitle'; +import AboutTitle from '.'; import renderer from 'react-test-renderer'; describe('AboutTitle', () => { diff --git a/__tests__/User/AboutModules/OverviewTab/__snapshots__/AboutTitle.test.js.snap b/components/User/OverviewTab/AboutTitle/__snapshots__/AboutTitle.test.jsx.snap similarity index 88% rename from __tests__/User/AboutModules/OverviewTab/__snapshots__/AboutTitle.test.js.snap rename to components/User/OverviewTab/AboutTitle/__snapshots__/AboutTitle.test.jsx.snap index 14daf617a..a20cc1d08 100644 --- a/__tests__/User/AboutModules/OverviewTab/__snapshots__/AboutTitle.test.js.snap +++ b/components/User/OverviewTab/AboutTitle/__snapshots__/AboutTitle.test.jsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`AboutTitle should match DOM Snapshot 1`] = ` +exports[`AboutTitle > should match DOM Snapshot 1`] = `
    diff --git a/components/User/OverviewTab/AboutTitle.js b/components/User/OverviewTab/AboutTitle/index.jsx similarity index 100% rename from components/User/OverviewTab/AboutTitle.js rename to components/User/OverviewTab/AboutTitle/index.jsx diff --git a/__tests__/User/AboutModules/OverviewTab/DepositList.test.js b/components/User/OverviewTab/DepositList/DepositList.test.jsx similarity index 97% rename from __tests__/User/AboutModules/OverviewTab/DepositList.test.js rename to components/User/OverviewTab/DepositList/DepositList.test.jsx index 8bc6785f3..c2abe1f74 100755 --- a/__tests__/User/AboutModules/OverviewTab/DepositList.test.js +++ b/components/User/OverviewTab/DepositList/DepositList.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; diff --git a/__tests__/User/AboutModules/OverviewTab/__snapshots__/DepositList.test.js.snap b/components/User/OverviewTab/DepositList/__snapshots__/DepositList.test.jsx.snap similarity index 94% rename from __tests__/User/AboutModules/OverviewTab/__snapshots__/DepositList.test.js.snap rename to components/User/OverviewTab/DepositList/__snapshots__/DepositList.test.jsx.snap index 427f7ff5e..b37aded68 100644 --- a/__tests__/User/AboutModules/OverviewTab/__snapshots__/DepositList.test.js.snap +++ b/components/User/OverviewTab/DepositList/__snapshots__/DepositList.test.jsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`DepositList should match DOM Snapshot 1`] = ` +exports[`DepositList > should match DOM Snapshot 1`] = `
    diff --git a/components/User/OverviewTab/DepositList.js b/components/User/OverviewTab/DepositList/index.jsx similarity index 91% rename from components/User/OverviewTab/DepositList.js rename to components/User/OverviewTab/DepositList/index.jsx index 91724e66e..cf2b1f8f3 100755 --- a/components/User/OverviewTab/DepositList.js +++ b/components/User/OverviewTab/DepositList/index.jsx @@ -2,7 +2,7 @@ import React from 'react'; // Custom -import DepositCard from '../../RefundBounty/DepositCard'; +import DepositCard from '../../../RefundBounty/DepositCard'; const DepositList = ({ deposits }) => { return ( diff --git a/__tests__/User/AboutModules/OverviewTab/EditableInput.test.js b/components/User/OverviewTab/EditableSocial/EditableSocial.test.jsx similarity index 91% rename from __tests__/User/AboutModules/OverviewTab/EditableInput.test.js rename to components/User/OverviewTab/EditableSocial/EditableSocial.test.jsx index 1dfce1bb7..90e1ac9a7 100644 --- a/__tests__/User/AboutModules/OverviewTab/EditableInput.test.js +++ b/components/User/OverviewTab/EditableSocial/EditableSocial.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; @@ -11,10 +11,10 @@ import InitialState from '../../../../store/Store/InitialState'; describe('EditableSocial', () => { beforeEach(() => { - const observe = jest.fn(); - const disconnect = jest.fn(); + const observe = vi.fn(); + const disconnect = vi.fn(); - window.IntersectionObserver = jest.fn(() => ({ + window.IntersectionObserver = vi.fn(() => ({ observe, disconnect, })); @@ -46,7 +46,7 @@ describe('EditableSocial', () => { }); describe('is Owner', () => { it('should be able to edit', async () => { - const updateUserMockFunc = jest.fn(); + const updateUserMockFunc = vi.fn(); const user = userEvent.setup(); const customInitialState = { ...InitialState, diff --git a/components/User/OverviewTab/EditableSocial.js b/components/User/OverviewTab/EditableSocial/index.jsx similarity index 94% rename from components/User/OverviewTab/EditableSocial.js rename to components/User/OverviewTab/EditableSocial/index.jsx index a2063879e..dfb034470 100644 --- a/components/User/OverviewTab/EditableSocial.js +++ b/components/User/OverviewTab/EditableSocial/index.jsx @@ -1,8 +1,8 @@ import React, { useContext, useState } from 'react'; -import Pencil from '../../svg/pencil'; -import StoreContext from '../../../store/Store/StoreContext'; -import CopyAddressToClipboard from '../../CopyAddressToClipboard'; -import ToolTipNew from '../../Utils/ToolTipNew'; +import Pencil from '../../../svg/pencil'; +import StoreContext from '../../../../store/Store/StoreContext'; +import CopyAddressToClipboard from '../../../CopyAddressToClipboard'; +import ToolTipNew from '../../../Utils/ToolTipNew'; const EditableSocial = ({ isOwner, social }) => { const [localSocial, setLocalSocial] = useState(social); diff --git a/components/User/OverviewTab/GithubConnection.js b/components/User/OverviewTab/GithubConnection.jsx similarity index 100% rename from components/User/OverviewTab/GithubConnection.js rename to components/User/OverviewTab/GithubConnection.jsx diff --git a/__tests__/User/AboutModules/OverviewTab/MiniBountyCard.test.js b/components/User/OverviewTab/MiniBountyCard/MiniBountyCard.test.jsx similarity index 82% rename from __tests__/User/AboutModules/OverviewTab/MiniBountyCard.test.js rename to components/User/OverviewTab/MiniBountyCard/MiniBountyCard.test.jsx index 1fb5d8790..b93af1753 100755 --- a/__tests__/User/AboutModules/OverviewTab/MiniBountyCard.test.js +++ b/components/User/OverviewTab/MiniBountyCard/MiniBountyCard.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; @@ -17,12 +17,12 @@ describe('MiniBountyCard', () => { tokenAddress: '0x0000000000000000000000000000000000000000', }; beforeEach(() => { - const observe = jest.fn(); - const disconnect = jest.fn(); + const observe = vi.fn(); + const disconnect = vi.fn(); process.env.NEXT_PUBLIC_COIN_API_URL = 'http://localhost:3030'; process.env.COIN_API_SSR_URL = 'http://localhost:3030'; - window.IntersectionObserver = jest.fn(() => ({ + window.IntersectionObserver = vi.fn(() => ({ observe, disconnect, })); @@ -33,7 +33,7 @@ describe('MiniBountyCard', () => { render(); // ASSERT - expect(screen.getByTestId('link')).toBeInTheDocument(); + expect(screen.getAllByTestId('link')[0]).toBeInTheDocument(); // should not have null or undefined values const nullish = [...screen.queryAllByRole(/null/), ...screen.queryAllByRole(/undefined/)]; diff --git a/components/User/OverviewTab/MiniBountyCard.js b/components/User/OverviewTab/MiniBountyCard/index.jsx similarity index 89% rename from components/User/OverviewTab/MiniBountyCard.js rename to components/User/OverviewTab/MiniBountyCard/index.jsx index 6e77c69d3..b50be7365 100755 --- a/components/User/OverviewTab/MiniBountyCard.js +++ b/components/User/OverviewTab/MiniBountyCard/index.jsx @@ -2,8 +2,8 @@ import React, { useState, useContext, useEffect } from 'react'; import Link from 'next/link'; -import StoreContext from '../../../store/Store/StoreContext'; -import useGetTokenValues from '../../../hooks/useGetTokenValues'; +import StoreContext from '../../../../store/Store/StoreContext'; +import useGetTokenValues from '../../../../hooks/useGetTokenValues'; const MiniBountyCard = ({ payout }) => { // Context const [appState] = useContext(StoreContext); diff --git a/__tests__/User/AboutModules/OverviewTab/MiniBountyList.test.js b/components/User/OverviewTab/MiniBountyList/MiniBountyList.test.jsx similarity index 98% rename from __tests__/User/AboutModules/OverviewTab/MiniBountyList.test.js rename to components/User/OverviewTab/MiniBountyList/MiniBountyList.test.jsx index 3a38206d8..c22c7da7a 100755 --- a/__tests__/User/AboutModules/OverviewTab/MiniBountyList.test.js +++ b/components/User/OverviewTab/MiniBountyList/MiniBountyList.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; diff --git a/__tests__/User/AboutModules/OverviewTab/__snapshots__/MiniBountyList.test.js.snap b/components/User/OverviewTab/MiniBountyList/__snapshots__/MiniBountyList.test.jsx.snap similarity index 89% rename from __tests__/User/AboutModules/OverviewTab/__snapshots__/MiniBountyList.test.js.snap rename to components/User/OverviewTab/MiniBountyList/__snapshots__/MiniBountyList.test.jsx.snap index 3b7435162..d76520a2e 100644 --- a/__tests__/User/AboutModules/OverviewTab/__snapshots__/MiniBountyList.test.js.snap +++ b/components/User/OverviewTab/MiniBountyList/__snapshots__/MiniBountyList.test.jsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`MiniBountyList should match DOM Snapshot 1`] = ` +exports[`MiniBountyList > should match DOM Snapshot 1`] = `
    diff --git a/components/User/OverviewTab/MiniBountyList.js b/components/User/OverviewTab/MiniBountyList/index.jsx similarity index 92% rename from components/User/OverviewTab/MiniBountyList.js rename to components/User/OverviewTab/MiniBountyList/index.jsx index 773b6fc66..f8e812856 100755 --- a/components/User/OverviewTab/MiniBountyList.js +++ b/components/User/OverviewTab/MiniBountyList/index.jsx @@ -2,7 +2,7 @@ import React from 'react'; // Custom -import MiniBountyCard from './MiniBountyCard'; +import MiniBountyCard from '../MiniBountyCard'; const MiniBountyList = ({ title, payouts }) => { return ( diff --git a/__tests__/User/AboutModules/OverviewTab/MiniDepositList.test.js b/components/User/OverviewTab/MiniDepositList/MiniDepositList.test.jsx similarity index 92% rename from __tests__/User/AboutModules/OverviewTab/MiniDepositList.test.js rename to components/User/OverviewTab/MiniDepositList/MiniDepositList.test.jsx index 94e835d4e..4c0d2bb84 100755 --- a/__tests__/User/AboutModules/OverviewTab/MiniDepositList.test.js +++ b/components/User/OverviewTab/MiniDepositList/MiniDepositList.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; @@ -39,10 +39,10 @@ describe('MiniDepositList', () => { ]; beforeEach(() => { - const observe = jest.fn(); - const disconnect = jest.fn(); + const observe = vi.fn(); + const disconnect = vi.fn(); - window.IntersectionObserver = jest.fn(() => ({ + window.IntersectionObserver = vi.fn(() => ({ observe, disconnect, })); diff --git a/components/User/OverviewTab/MiniDepositList.js b/components/User/OverviewTab/MiniDepositList/index.jsx similarity index 90% rename from components/User/OverviewTab/MiniDepositList.js rename to components/User/OverviewTab/MiniDepositList/index.jsx index f8cd6bee1..fbbead2fc 100755 --- a/components/User/OverviewTab/MiniDepositList.js +++ b/components/User/OverviewTab/MiniDepositList/index.jsx @@ -2,7 +2,7 @@ import React from 'react'; // Custom -import MiniDepositCard from '../../Bounty/MiniDepositCard'; +import MiniDepositCard from '../../../Bounty/MiniDepositCard'; const MiniDepositList = ({ deposits }) => { return ( diff --git a/__tests__/User/AboutModules/OverviewTab/Roles.test.js b/components/User/OverviewTab/Roles/Roles.test.jsx similarity index 92% rename from __tests__/User/AboutModules/OverviewTab/Roles.test.js rename to components/User/OverviewTab/Roles/Roles.test.jsx index 62541ff9a..6b79ffa46 100644 --- a/__tests__/User/AboutModules/OverviewTab/Roles.test.js +++ b/components/User/OverviewTab/Roles/Roles.test.jsx @@ -1,5 +1,5 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; @@ -12,10 +12,10 @@ import Constants from '../../../../test-utils/constant'; describe('Roles', () => { beforeEach(() => { - const observe = jest.fn(); - const disconnect = jest.fn(); + const observe = vi.fn(); + const disconnect = vi.fn(); - window.IntersectionObserver = jest.fn(() => ({ + window.IntersectionObserver = vi.fn(() => ({ observe, disconnect, })); @@ -42,7 +42,7 @@ describe('Roles', () => { describe('is Owner', () => { it('should be able to edit', async () => { - const updateUserMockFunc = jest.fn(); + const updateUserMockFunc = vi.fn(); const user = userEvent.setup(); const customInitialState = { ...InitialState, diff --git a/components/User/OverviewTab/Roles.js b/components/User/OverviewTab/Roles/index.jsx similarity index 96% rename from components/User/OverviewTab/Roles.js rename to components/User/OverviewTab/Roles/index.jsx index 04f451151..101a53cd7 100644 --- a/components/User/OverviewTab/Roles.js +++ b/components/User/OverviewTab/Roles/index.jsx @@ -1,6 +1,6 @@ import React, { useContext, useState } from 'react'; -import Cross from '../../svg/cross'; -import StoreContext from '../../../store/Store/StoreContext'; +import Cross from '../../../svg/cross'; +import StoreContext from '../../../../store/Store/StoreContext'; const Roles = ({ defaultRoles, category, user }) => { const [roles, setRoles] = useState(defaultRoles); diff --git a/__tests__/User/AboutModules/OverviewTab/Skills.test.js b/components/User/OverviewTab/Skills/Skills.test.jsx similarity index 100% rename from __tests__/User/AboutModules/OverviewTab/Skills.test.js rename to components/User/OverviewTab/Skills/Skills.test.jsx diff --git a/__tests__/User/AboutModules/OverviewTab/__snapshots__/Skills.test.js.snap b/components/User/OverviewTab/Skills/__snapshots__/Skills.test.jsx.snap similarity index 96% rename from __tests__/User/AboutModules/OverviewTab/__snapshots__/Skills.test.js.snap rename to components/User/OverviewTab/Skills/__snapshots__/Skills.test.jsx.snap index 50e5286e5..a6cbd12d0 100644 --- a/__tests__/User/AboutModules/OverviewTab/__snapshots__/Skills.test.js.snap +++ b/components/User/OverviewTab/Skills/__snapshots__/Skills.test.jsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Skills should match DOM Snapshot 1`] = ` +exports[`Skills > should match DOM Snapshot 1`] = `
    diff --git a/components/User/OverviewTab/Skills.js b/components/User/OverviewTab/Skills/index.jsx similarity index 95% rename from components/User/OverviewTab/Skills.js rename to components/User/OverviewTab/Skills/index.jsx index 1a62316c8..3e3e610f9 100644 --- a/components/User/OverviewTab/Skills.js +++ b/components/User/OverviewTab/Skills/index.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import Roles from './Roles'; +import Roles from '../Roles'; const Skills = ({ user }) => { return ( diff --git a/__tests__/User/AboutModules/UserHistory.test.js b/components/User/OverviewTab/UserHistory/UserHistory.test.jsx similarity index 84% rename from __tests__/User/AboutModules/UserHistory.test.js rename to components/User/OverviewTab/UserHistory/UserHistory.test.jsx index efa5aee54..6a4a4e81d 100755 --- a/__tests__/User/AboutModules/UserHistory.test.js +++ b/components/User/OverviewTab/UserHistory/UserHistory.test.jsx @@ -1,10 +1,10 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import { render, screen } from '../../../test-utils'; -import UserHistory from '../../../components/User/OverviewTab/UserHistory'; +import { render, screen } from '../../../../test-utils'; +import UserHistory from '.'; describe('UserHistory', () => { const payouts = [ @@ -32,12 +32,12 @@ describe('UserHistory', () => { }, ]; beforeEach(() => { - const observe = jest.fn(); - const disconnect = jest.fn(); + const observe = vi.fn(); + const disconnect = vi.fn(); process.env.NEXT_PUBLIC_COIN_API_URL = 'http://localhost:3030'; process.env.COIN_API_SSR_URL = 'http://localhost:3030'; - window.IntersectionObserver = jest.fn(() => ({ + window.IntersectionObserver = vi.fn(() => ({ observe, disconnect, })); diff --git a/components/User/OverviewTab/UserHistory.js b/components/User/OverviewTab/UserHistory/index.jsx similarity index 92% rename from components/User/OverviewTab/UserHistory.js rename to components/User/OverviewTab/UserHistory/index.jsx index 34e9716ac..711874e12 100755 --- a/components/User/OverviewTab/UserHistory.js +++ b/components/User/OverviewTab/UserHistory/index.jsx @@ -1,8 +1,8 @@ // Third party import React, { useState, useEffect, useContext } from 'react'; // Custom -import AvatarPack from '../../Utils/AvatarPack'; -import StoreContext from '../../../store/Store/StoreContext'; +import AvatarPack from '../../../Utils/AvatarPack'; +import StoreContext from '../../../../store/Store/StoreContext'; const UserHistory = ({ payouts }) => { // Context diff --git a/components/User/OverviewTab/UserSocials.js b/components/User/OverviewTab/UserSocials.jsx similarity index 100% rename from components/User/OverviewTab/UserSocials.js rename to components/User/OverviewTab/UserSocials.jsx diff --git a/components/User/OverviewTab/Username/Username.test.js b/components/User/OverviewTab/Username/Username.test.jsx similarity index 100% rename from components/User/OverviewTab/Username/Username.test.js rename to components/User/OverviewTab/Username/Username.test.jsx diff --git a/components/User/OverviewTab/Username/__snapshots__/Username.test.js.snap b/components/User/OverviewTab/Username/__snapshots__/Username.test.js.snap index 82d4dc87f..3c7797513 100644 --- a/components/User/OverviewTab/Username/__snapshots__/Username.test.js.snap +++ b/components/User/OverviewTab/Username/__snapshots__/Username.test.js.snap @@ -1,4 +1,4 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// vi Snapshot v1, https://goo.gl/fbAQLP exports[`Username should match initial DOM Snapshot for FirstSignupModal 1`] = ` diff --git a/components/User/OverviewTab/Username/__snapshots__/Username.test.jsx.snap b/components/User/OverviewTab/Username/__snapshots__/Username.test.jsx.snap new file mode 100644 index 000000000..a8097e405 --- /dev/null +++ b/components/User/OverviewTab/Username/__snapshots__/Username.test.jsx.snap @@ -0,0 +1,50 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Username > should match initial DOM Snapshot for FirstSignupModal 1`] = ` + +
    +
    +
    +
    + Christopher +
    +
    +
    +
    +
    +`; + +exports[`Username > should match initial DOM Snapshot for user profile page 1`] = ` + +
    +
    +
    + Username +
    +
    +
    + Christopher +
    +
    +
    +
    +
    +`; diff --git a/components/User/OverviewTab/Username/index.js b/components/User/OverviewTab/Username/index.jsx similarity index 100% rename from components/User/OverviewTab/Username/index.js rename to components/User/OverviewTab/Username/index.jsx diff --git a/components/User/ProfileTabWrapper.js b/components/User/ProfileTabWrapper.jsx similarity index 100% rename from components/User/ProfileTabWrapper.js rename to components/User/ProfileTabWrapper.jsx diff --git a/__tests__/User/StarsTab/Starred.test.js b/components/User/StarsTab/Starred/Starred.test.jsx similarity index 85% rename from __tests__/User/StarsTab/Starred.test.js rename to components/User/StarsTab/Starred/Starred.test.jsx index d64f6c077..e97a45cd9 100755 --- a/__tests__/User/StarsTab/Starred.test.js +++ b/components/User/StarsTab/Starred/Starred.test.jsx @@ -1,11 +1,11 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import { render, screen } from '../../../test-utils'; -import mocks from '../../../__mocks__/mock-server.json'; -import Starred from '../../../components/User/StarsTab/Starred'; +import { render, screen } from '../../../../test-utils'; +import mocks from '../../../../__mocks__/mock-server.json'; +import Starred from '.'; import ShallowRenderer from 'react-test-renderer/shallow'; describe('Starred', () => { diff --git a/__tests__/User/StarsTab/__snapshots__/Starred.test.js.snap b/components/User/StarsTab/Starred/__snapshots__/Starred.test.jsx.snap similarity index 99% rename from __tests__/User/StarsTab/__snapshots__/Starred.test.js.snap rename to components/User/StarsTab/Starred/__snapshots__/Starred.test.jsx.snap index 801a81723..1ef738d84 100644 --- a/__tests__/User/StarsTab/__snapshots__/Starred.test.js.snap +++ b/components/User/StarsTab/Starred/__snapshots__/Starred.test.jsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Starred should render match DOM Snapshot 1`] = ` +exports[`Starred > should render match DOM Snapshot 1`] = ` { return ( diff --git a/components/User/StarsTab/__snapshots__/Starred.test.jsx.snap b/components/User/StarsTab/__snapshots__/Starred.test.jsx.snap new file mode 100644 index 000000000..1ef738d84 --- /dev/null +++ b/components/User/StarsTab/__snapshots__/Starred.test.jsx.snap @@ -0,0 +1,891 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Starred > should render match DOM Snapshot 1`] = ` + +
    + Free, open-source work platform tailored for software development
    ", + "email": "info@openq.dev", + "fundedTokenBalances": [ + { + "__typename": "OrganizationFundedTokenBalance", + "id": "MDEyOk9yZ2FuaXphdGlvbjc3NDAyNTM4-0x0000000000000000000000000000000000000000", + "tokenAddress": "0x0000000000000000000000000000000000000000", + "volume": "23000000000000000000", + }, + { + "__typename": "OrganizationFundedTokenBalance", + "id": "MDEyOk9yZ2FuaXphdGlvbjc3NDAyNTM4-0x5fbdb2315678afecb367f032d93f642f64180aa3", + "tokenAddress": "0x5fbdb2315678afecb367f032d93f642f64180aa3", + "volume": "12000000000000000000", + }, + ], + "id": "MDEyOk9yZ2FuaXphdGlvbjc3NDAyNTM4", + "isVerified": false, + "login": "OpenQDev", + "membersWithRole": { + "__typename": "OrganizationMemberConnection", + "nodes": [ + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/13041?u=048e83e6757dab8a264a3adaf6db1b5130f2f9f1&v=4", + "name": "Guillermo Rauch", + "url": "https://github.com/rauchg", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/20542?u=2d5b4512b81ab00c9e57f42780bd9ebd2c914e9f&v=4", + "name": "Nathan Hammond", + "url": "https://github.com/nathanhammond", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/25966?u=fd866ec42bdc141a9fe09e9039388f98bf80aa9c&v=4", + "name": "Francis Gulotta", + "url": "https://github.com/reconbot", + }, + ], + }, + "name": "OpenQ Labs", + "payoutTokenBalances": [], + "payouts": [ + { + "__typename": "Payout", + "id": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266-0x3ca8f9c04c7e3e1624ac2008f92f6f366a869444-0x0000000000000000000000000000000000000000-1654260979", + "payoutTime": "1654260979", + "tokenAddress": "0x0000000000000000000000000000000000000000", + "volume": "12000000000000000000", + }, + { + "__typename": "Payout", + "id": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266-0x3ca8f9c04c7e3e1624ac2008f92f6f366a869444-0x5fbdb2315678afecb367f032d93f642f64180aa3-1654260979", + "payoutTime": "1654260979", + "tokenAddress": "0x5fbdb2315678afecb367f032d93f642f64180aa3", + "volume": "12000000000000000000", + }, + ], + "starred": true, + "twitterUsername": "openqlabs", + "url": "https://github.com/OpenQDev", + "websiteUrl": "https://www.openq.dev", + } + } + starringParent="true" + /> + Develop. Preview. Ship. Creators of Next.js.
    ", + "email": "support@vercel.com", + "fundedTokenBalances": [], + "id": "MDEyOk9yZ2FuaXphdGlvbjE0OTg1MDIw", + "isVerified": true, + "location": "Global", + "login": "vercel", + "membersWithRole": { + "__typename": "OrganizationMemberConnection", + "nodes": [ + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/13041?u=048e83e6757dab8a264a3adaf6db1b5130f2f9f1&v=4", + "name": "Guillermo Rauch", + "url": "https://github.com/rauchg", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/20542?u=2d5b4512b81ab00c9e57f42780bd9ebd2c914e9f&v=4", + "name": "Nathan Hammond", + "url": "https://github.com/nathanhammond", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/25966?u=fd866ec42bdc141a9fe09e9039388f98bf80aa9c&v=4", + "name": "Francis Gulotta", + "url": "https://github.com/reconbot", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/71256?u=d6a9598cd7963ae290923ab12afeff947f542f80&v=4", + "name": "Nathan Rajlich", + "url": "https://github.com/TooTallNate", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/112982?u=69a62ef075d31a813357f3055f1fa7ec6af24535&v=4", + "name": "Justin Ridgewell", + "url": "https://github.com/jridgewell", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/123822?u=5c91160ac439795400183bac330905155bee1a90&v=4", + "name": "Vincent Voyer", + "url": "https://github.com/vvo", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/179761?u=1c474e07ef034242186fea0b914856db20313eb5&v=4", + "name": "William Li", + "url": "https://github.com/williamli", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/200112?u=a450e86395298e876523a1daf5c39bf1cd9d30c1&v=4", + "name": "Sebastian Roming", + "url": "https://github.com/sebastianroming", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/209817?u=7f8a7e0c283e1cd3a5b282d08d54b5a12d3796de&v=4", + "name": "Peter van der Zee", + "url": "https://github.com/pvdz", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/229881?u=58675cc3f9993517e5f29209ccba960d79b719ad&v=4", + "name": "Steven", + "url": "https://github.com/styfle", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/517210?v=4", + "name": "Lindsey Simon", + "url": "https://github.com/elsigh", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/556932?u=096b758165ea2694da5dfafda89153985c196d5f&v=4", + "name": "Jeff Escalante", + "url": "https://github.com/jescalan", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/616428?u=f5e8bd43978beb76f65bbcdc8a482056acaa55cc&v=4", + "name": "Joe Haddad", + "url": "https://github.com/Timer", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/755844?v=4", + "name": "Will Binns-Smith", + "url": "https://github.com/wbinnssmith", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/775227?u=2a58759e703e449e637bb11f60545f09a1051a06&v=4", + "name": "Naoyuki Kanezawa", + "url": "https://github.com/nkzawa", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/992008?u=8dbd9a103ee7090623ebd105434414b454b54e86&v=4", + "name": "Shu Uesugi", + "url": "https://github.com/chibicode", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/1000405?u=c23babafc6485065ef1c8324c03c913f87e71922&v=4", + "name": "Bret Hudson", + "url": "https://github.com/BretHudson", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/1130014?u=fba98e9b0c56df115175b294898cf38f108c3f4f&v=4", + "name": "Edward Thomson", + "url": "https://github.com/ethomson", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/1162991?u=ea2bcb5fb4aea5d36b1bc824a557b0582a1f77be&v=4", + "name": "Swarnava Sengupta", + "url": "https://github.com/swarnava", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/1365881?v=4", + "name": "Tobias Koppers", + "url": "https://github.com/sokra", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/1401559?u=14e2c238c5635fc0d112483a37a924062bff1762&v=4", + "name": "Bel", + "url": "https://github.com/okbel", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/1508008?v=4", + "name": "Mark Glagola", + "url": "https://github.com/mglagola", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/1634922?u=8b6e564a14939d2911b179a14c3af1973b12d315&v=4", + "name": "Javi Velasco", + "url": "https://github.com/javivelasco", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/2009676?u=a0480d1246a2db1458e0416fcc0f9685481956de&v=4", + "name": "Javier Bórquez", + "url": "https://github.com/javierbyte", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/2020473?u=1822b7ee0882022e9e5dcdd54523d9e1e0925244&v=4", + "name": "Ian Jones", + "url": "https://github.com/WITS", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/2096101?u=b5b169cca744d3c2323175c62cba6983ccd5c7c9&v=4", + "name": "Kiko Beats", + "url": "https://github.com/Kikobeats", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/2198240?v=4", + "name": null, + "url": "https://github.com/balazs4", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/2865858?u=27c3f8e33e79d063c5100a3ed6c06149fa2cd77f&v=4", + "name": "Maia Teegarden", + "url": "https://github.com/padmaia", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/3468483?u=daf25d236ad2cc227470fa0da2d5bdf3dbb7feed&v=4", + "name": "LongYinan", + "url": "https://github.com/Brooooooklyn", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/3580111?u=d4763fd8b3005b32e64342f495d61a0a8aaab7f2&v=4", + "name": "jeffrey", + "url": "https://github.com/jarneson", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/3676859?u=a866d19c4fce64bf67a084eb32f29bb6e84020a5&v=4", + "name": "Shu Ding", + "url": "https://github.com/shuding", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/4271679?u=f1f18b695144bd6ce58cb058306dcff7a2c11470&v=4", + "name": "Kaiyu Hsu", + "url": "https://github.com/kyh", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/4278345?u=2f0aec09054350f8b2878b832ad75ca5b84b01ac&v=4", + "name": "Luis Alvarez D.", + "url": "https://github.com/lfades", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/4721750?u=1402012e5e42beeeec00015203f095d15ac5431c&v=4", + "name": "Matheus Fernandes", + "url": "https://github.com/matheuss", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/4800338?u=b6bc3bdb43bba5681d1e1767af0004758a3c5af8&v=4", + "name": "Jiachi Liu", + "url": "https://github.com/huozhi", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/5043083?u=ec584c5db0560973cf564f09520dc631c01e5e10&v=4", + "name": "Brody McKee", + "url": "https://github.com/mrmckeb", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/5818726?v=4", + "name": "Caleb Boyd", + "url": "https://github.com/calebboyd", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/6324199?u=4bf20067bc68295cbc46fd57c3fe88d508f3305a&v=4", + "name": "Tim Neutkens", + "url": "https://github.com/timneutkens", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/6616955?u=80838a7a4a7d2a091e5fd00b16245a65bd8435c2&v=4", + "name": "Luc Leray", + "url": "https://github.com/lucleray", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/6849494?u=3f5c9babf5de70f61dd76a21ec7f939657e254bf&v=4", + "name": "Ben Seymour", + "url": "https://github.com/bseymour", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/6880091?u=da42714aac11597801cdded4c02ea6123f87888e&v=4", + "name": "Evil Rabbit", + "url": "https://github.com/evilrabbit", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/7249920?u=1511fd3e1c69c9a3c54f97f1733a5934caf9c2ce&v=4", + "name": "Chris", + "url": "https://github.com/chriswdmr", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/7690649?u=d0d1502ede1d3c02496be51652dc88334deb68d6&v=4", + "name": "paulogdm", + "url": "https://github.com/paulogdm", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/7945257?v=4", + "name": "Mitchell Wright", + "url": "https://github.com/mitchellwright", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/8069675?u=4586224bf7493d07bbed66a63ca032266d383dcd&v=4", + "name": "Thomas Mickley-Doyle", + "url": "https://github.com/tmickleydoyle", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/8146736?u=7d9ca9170c0df05dad1d27da60d1357245e307ae&v=4", + "name": "Florentin / 珞辰", + "url": "https://github.com/ecklf", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/8440026?u=92fe33e1864b024f28348a25ebb13c7025092114&v=4", + "name": "Christopher", + "url": "https://github.com/skllcrn", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/8675906?u=a331caeb60a15653560b067f60116ca9b43a37ad&v=4", + "name": "Max Leiter", + "url": "https://github.com/MaxLeiter", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/8845940?u=8f81a5bc07995d2c218339a4142463ce46e26237&v=4", + "name": "Leah", + "url": "https://github.com/ForsakenHarmony", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/9113740?u=6b5c9843f6d345ee178d1171dd3025610312af35&v=4", + "name": "Lee Robinson", + "url": "https://github.com/leerob", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/11383626?v=4", + "name": "Cody Ogden", + "url": "https://github.com/codyogden", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/11965195?u=684de98d1765f5354c36d82efdbbd604650c82aa&v=4", + "name": "Cody Brouwers", + "url": "https://github.com/codybrouwers", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/12075218?u=5bab910b01f92565db72244155c7b29d72d01ffd&v=4", + "name": "Elijah Cobb", + "url": "https://github.com/elijahjcobb", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/14811170?u=928698e6d968014ea24b7665491cdbf807a25cd2&v=4", + "name": "Matthew Stanciu", + "url": "https://github.com/MatthewStanciu", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/15165138?u=bdbafd9715a04e1fe321714f077aad03c7e87932&v=4", + "name": "Samuel Foster", + "url": "https://github.com/FosterSamuel", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/18369201?u=04a8116c83fc5ebbf2000e2e7333a7e388102d97&v=4", + "name": "Balázs Orbán", + "url": "https://github.com/balazsorban44", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/22380829?u=0d3d36a4bef923933ffa54c609191dbae9988642&v=4", + "name": "JJ Kasper", + "url": "https://github.com/ijjk", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/25056922?u=adceaebc5bd75972e87667289f00f4b17d2f791f&v=4", + "name": "Hannes Bornö", + "url": "https://github.com/hanneslund", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/26944716?u=f6456edd60fb60c60a67292c90c03f58a8c6faa2&v=4", + "name": "Matthew Sweeney", + "url": "https://github.com/mcsdevv", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/28912696?u=cf1b0febc6935d35a4b640fccaed0059bfdffa9f&v=4", + "name": "Sam Ko", + "url": "https://github.com/samsisle", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/29439845?u=4ec7ccf6b62bac00be89972a082730528ce8c114&v=4", + "name": "Hank Taylor", + "url": "https://github.com/theHankTaylor", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/29451794?u=511b26caf0ad283231a4e1a7aad2be9518563707&v=4", + "name": "Lydia Hallie", + "url": "https://github.com/lydiahallie", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/29931815?u=38146b0b29a3bd2425cc19f91bfc7c0e82a20997&v=4", + "name": "Donny/강동윤", + "url": "https://github.com/kdy1", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/30479228?u=73a077415d43859eb681e243e49dfefc2bf57862&v=4", + "name": "Kylie Czajkowski", + "url": "https://github.com/kale-stew", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/34559231?u=6219adfd2c117396731a73f5b6be18a2ba4cea02&v=4", + "name": "Andrew Healey", + "url": "https://github.com/healeycodes", + }, + { + "__typename": "User", + "avatarUrl": "https://avatars.githubusercontent.com/u/35507539?u=8e9c3161551e0cd43029d3c54692cba302ceaafa&v=4", + "name": "Ana Trajkovska", + "url": "https://github.com/anatrajkovska", + }, + ], + }, + "name": "Vercel", + "payoutTokenBalances": [], + "payouts": [], + "starred": true, + "twitterUsername": null, + "url": "https://github.com/vercel", + "websiteUrl": "https://vercel.com", + } + } + starringParent="true" + /> + + +
    + +`; diff --git a/__tests__/User/WatchingTab/Watching.test.js b/components/User/WatchingTab/Watching/Watching.test.jsx similarity index 81% rename from __tests__/User/WatchingTab/Watching.test.js rename to components/User/WatchingTab/Watching/Watching.test.jsx index 118ba930f..4b7202517 100755 --- a/__tests__/User/WatchingTab/Watching.test.js +++ b/components/User/WatchingTab/Watching/Watching.test.jsx @@ -1,21 +1,21 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import { render, screen } from '../../../test-utils'; -import Watching from '../../../components/User/WatchingTab/Watching'; +import { render, screen } from '../../../../test-utils'; +import Watching from '.'; import userEvent from '@testing-library/user-event'; -import Constants from '../../../test-utils/constant'; +import Constants from '../../../../test-utils/constant'; import ShallowRenderer from 'react-test-renderer/shallow'; describe('Watching', () => { const bounties = Constants.bounties; beforeEach(() => { - const observe = jest.fn(); - const disconnect = jest.fn(); + const observe = vi.fn(); + const disconnect = vi.fn(); - window.IntersectionObserver = jest.fn(() => ({ + window.IntersectionObserver = vi.fn(() => ({ observe, disconnect, })); diff --git a/__tests__/User/WatchingTab/__snapshots__/Watching.test.js.snap b/components/User/WatchingTab/Watching/__snapshots__/Watching.test.jsx.snap similarity index 84% rename from __tests__/User/WatchingTab/__snapshots__/Watching.test.js.snap rename to components/User/WatchingTab/Watching/__snapshots__/Watching.test.jsx.snap index afd39d42c..3581ec9b8 100644 --- a/__tests__/User/WatchingTab/__snapshots__/Watching.test.js.snap +++ b/components/User/WatchingTab/Watching/__snapshots__/Watching.test.jsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Watching should render match DOM Snapshot 1`] = ` +exports[`Watching > should render match DOM Snapshot 1`] = ` body of test2

    ", + "bodyHTML": "

    body of test2

    ", "bountyAddress": "0x066efd87027a4cc4a21c57467f224ef98241d774", "bountyId": "I_kwDOGWnnz85I9Agl", "bountyMintTime": "1662545344", @@ -142,8 +142,9 @@ exports[`Watching should render match DOM Snapshot 1`] = ` }, }, "body": "This Closes #136 and also unrelated thing of Fixes #137", - "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", + "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", "bodyText": "This Closes #136 and also unrelated thing of Fixes #137", + "createdAt": "2022-03-28T17:57:44Z", "id": "PR_kwDOGWnnz841LGsK", "mergeCommit": { "__typename": "Commit", @@ -193,7 +194,7 @@ exports[`Watching should render match DOM Snapshot 1`] = ` "assignees": [], "avatarUrl": "https://avatars.githubusercontent.com/u/77402538?v=4", "body": "body of test2", - "bodyHTML": "

    body of test2

    ", + "bodyHTML": "

    body of test2

    ", "bountyAddress": "0x066efd87027a4cc4a21c57467f224ef98241d774", "bountyId": "I_kwDOGWnnz85I9Agl", "bountyMintTime": "1662545344", @@ -321,8 +322,9 @@ exports[`Watching should render match DOM Snapshot 1`] = ` }, }, "body": "This Closes #136 and also unrelated thing of Fixes #137", - "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", + "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", "bodyText": "This Closes #136 and also unrelated thing of Fixes #137", + "createdAt": "2022-03-28T17:57:44Z", "id": "PR_kwDOGWnnz841LGsK", "mergeCommit": { "__typename": "Commit", @@ -372,7 +374,7 @@ exports[`Watching should render match DOM Snapshot 1`] = ` "assignees": [], "avatarUrl": "https://avatars.githubusercontent.com/u/77402538?v=4", "body": "body of test2", - "bodyHTML": "

    body of test2

    ", + "bodyHTML": "

    body of test2

    ", "bountyAddress": "0x066efd87027a4cc4a21c57467f224ef98241d774", "bountyId": "I_kwDOGWnnz85I9Agl", "bountyMintTime": "1662545344", @@ -503,8 +505,9 @@ exports[`Watching should render match DOM Snapshot 1`] = ` }, }, "body": "This Closes #136 and also unrelated thing of Fixes #137", - "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", + "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", "bodyText": "This Closes #136 and also unrelated thing of Fixes #137", + "createdAt": "2022-03-28T17:57:44Z", "id": "PR_kwDOGWnnz841LGsK", "mergeCommit": { "__typename": "Commit", @@ -554,7 +557,7 @@ exports[`Watching should render match DOM Snapshot 1`] = ` "assignees": [], "avatarUrl": "https://avatars.githubusercontent.com/u/77402538?v=4", "body": "body of test2", - "bodyHTML": "

    body of test2

    ", + "bodyHTML": "

    body of test2

    ", "bountyAddress": "0x066efd87027a4cc4a21c57467f224ef98241d774", "bountyId": "I_kwDOGWnnz85I9Agl", "bountyMintTime": "1662545344", @@ -686,8 +689,9 @@ exports[`Watching should render match DOM Snapshot 1`] = ` }, }, "body": "This Closes #136 and also unrelated thing of Fixes #137", - "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", + "bodyHTML": "

    This Closes #136 and also unrelated thing of Fixes #137

    ", "bodyText": "This Closes #136 and also unrelated thing of Fixes #137", + "createdAt": "2022-03-28T17:57:44Z", "id": "PR_kwDOGWnnz841LGsK", "mergeCommit": { "__typename": "Commit", diff --git a/components/User/WatchingTab/Watching.js b/components/User/WatchingTab/Watching/index.jsx similarity index 88% rename from components/User/WatchingTab/Watching.js rename to components/User/WatchingTab/Watching/index.jsx index dbae628be..4fdf5467b 100755 --- a/components/User/WatchingTab/Watching.js +++ b/components/User/WatchingTab/Watching/index.jsx @@ -2,8 +2,8 @@ import React, { useState } from 'react'; // Custom -import BountyCardLean from '../../BountyCard/BountyCardLean'; -import ProfileTabWrapper from '../ProfileTabWrapper'; +import BountyCardLean from '../../../BountyCard/BountyCardLean'; +import ProfileTabWrapper from '../../ProfileTabWrapper'; const Watching = ({ watchedBounties }) => { const [statefulWatched, setStatefulWatched] = useState(watchedBounties); diff --git a/components/Utils/ActionBubble/ActionBubble.test.js b/components/Utils/ActionBubble/ActionBubble.test.jsx similarity index 96% rename from components/Utils/ActionBubble/ActionBubble.test.js rename to components/Utils/ActionBubble/ActionBubble.test.jsx index a76661cc6..cde329348 100755 --- a/components/Utils/ActionBubble/ActionBubble.test.js +++ b/components/Utils/ActionBubble/ActionBubble.test.jsx @@ -1,17 +1,17 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import { render, screen } from '../../../test-utils/'; +import { render, screen } from '../../../test-utils'; import { waitFor } from '@testing-library/react'; import ActionBubble from '.'; import nextRouter from 'next/router'; import userEvent from '@testing-library/user-event'; // Test cases for full balances, empty balances, and undefined balances. -nextRouter.useRouter = jest.fn(); -const push = jest.fn(() => { - return { catch: jest.fn }; +nextRouter.useRouter = vi.fn(); +const push = vi.fn(() => { + return { catch: vi.fn }; }); const bounty = { id: 'I_kwDOGAqhQc48U5_r', @@ -168,8 +168,8 @@ describe('ActionBubble', () => { beforeEach(() => { nextRouter.useRouter.mockImplementation(() => ({ query: { type: null }, - prefetch: jest.fn(() => { - return { catch: jest.fn }; + prefetch: vi.fn(() => { + return { catch: vi.fn }; }), push, })); @@ -261,7 +261,7 @@ describe('ActionBubble', () => { }); // ASSERT - expect(await screen.findByText('sample.eth closed this contract on January 3, 1970 at 7:33.')); + expect(await screen.findByText('0xf3...2266 closed this contract on January 3, 1970 at 7:33.')); }); it('should display pull request linked action message', async () => { // ARRANGE diff --git a/components/Utils/ActionBubble/index.js b/components/Utils/ActionBubble/index.jsx similarity index 99% rename from components/Utils/ActionBubble/index.js rename to components/Utils/ActionBubble/index.jsx index 73e899688..ca893482a 100755 --- a/components/Utils/ActionBubble/index.js +++ b/components/Utils/ActionBubble/index.jsx @@ -5,9 +5,9 @@ import useGetTokenValues from '../../../hooks/useGetTokenValues'; import StoreContext from '../../../store/Store/StoreContext'; import useEns from '../../../hooks/useENS'; import { ethers } from 'ethers'; -import Jazzicon from './../Jazzicon'; +import Jazzicon from '../Jazzicon'; import useWeb3 from '../../../hooks/useWeb3'; -import ToolTipNew from './../ToolTipNew'; +import ToolTipNew from '../ToolTipNew'; const ActionBubble = ({ bounty, action }) => { const [appState] = useContext(StoreContext); diff --git a/__tests__/Utils/AvatarPack.test.js b/components/Utils/AvatarPack/AvatarPack.test.jsx similarity index 87% rename from __tests__/Utils/AvatarPack.test.js rename to components/Utils/AvatarPack/AvatarPack.test.jsx index b0cec2b59..81fcc5b95 100755 --- a/__tests__/Utils/AvatarPack.test.js +++ b/components/Utils/AvatarPack/AvatarPack.test.jsx @@ -1,8 +1,8 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import AvatarPack from '../../components/Utils/AvatarPack'; +import AvatarPack from '.'; import renderer from 'react-test-renderer'; // Test cases for full balances, empty balances, and undefined balances. diff --git a/__tests__/Utils/__snapshots__/AvatarPack.test.js.snap b/components/Utils/AvatarPack/__snapshots__/AvatarPack.test.jsx.snap similarity index 94% rename from __tests__/Utils/__snapshots__/AvatarPack.test.js.snap rename to components/Utils/AvatarPack/__snapshots__/AvatarPack.test.jsx.snap index 926ced76d..14c05ddb5 100644 --- a/__tests__/Utils/__snapshots__/AvatarPack.test.js.snap +++ b/components/Utils/AvatarPack/__snapshots__/AvatarPack.test.jsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`AvatarPack should match DOM Snapshot 1`] = ` +exports[`AvatarPack > should match DOM Snapshot 1`] = `
    diff --git a/components/Utils/AvatarPack.js b/components/Utils/AvatarPack/index.jsx similarity index 96% rename from components/Utils/AvatarPack.js rename to components/Utils/AvatarPack/index.jsx index ca1974bac..0347cf9c1 100755 --- a/components/Utils/AvatarPack.js +++ b/components/Utils/AvatarPack/index.jsx @@ -3,7 +3,7 @@ import React from 'react'; import Link from 'next/link'; import Image from 'next/image'; -import ToolTipNew from './ToolTipNew'; +import ToolTipNew from '../ToolTipNew'; const AvatarPack = ({ avatars }) => { return ( diff --git a/__tests__/Utils/Carousel.test.js b/components/Utils/Carousel/Carousel.test.jsx similarity index 93% rename from __tests__/Utils/Carousel.test.js rename to components/Utils/Carousel/Carousel.test.jsx index d6a5944e4..f7eabccfd 100755 --- a/__tests__/Utils/Carousel.test.js +++ b/components/Utils/Carousel/Carousel.test.jsx @@ -1,17 +1,17 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import { render, screen, waitFor } from '../../test-utils'; -import Carousel from '../../components/Utils/Carousel'; -import CarouselBounty from '../../components/Bounty/CarouselBounty'; +import { render, screen, waitFor } from '../../../test-utils'; +import Carousel from '.'; +import CarouselBounty from '../../Bounty/CarouselBounty'; import nextRouter from 'next/router'; import ShallowRenderer from 'react-test-renderer/shallow'; // Test cases for full balances, empty balances, and undefined balances. -nextRouter.useRouter = jest.fn(); -const push = jest.fn(() => { - return { catch: jest.fn }; +nextRouter.useRouter = vi.fn(); +const push = vi.fn(() => { + return { catch: vi.fn }; }); const bounty = { id: 'I_kwDOGAqhQc48U5_r', @@ -167,8 +167,8 @@ describe('Carousel', () => { beforeEach(() => { nextRouter.useRouter.mockImplementation(() => ({ query: { type: null }, - prefetch: jest.fn(() => { - return { catch: jest.fn }; + prefetch: vi.fn(() => { + return { catch: vi.fn }; }), push, })); diff --git a/__tests__/Utils/__snapshots__/Carousel.test.js.snap b/components/Utils/Carousel/__snapshots__/Carousel.test.jsx.snap similarity index 69% rename from __tests__/Utils/__snapshots__/Carousel.test.js.snap rename to components/Utils/Carousel/__snapshots__/Carousel.test.jsx.snap index 7a77cbc8c..2c54ec060 100644 --- a/__tests__/Utils/__snapshots__/Carousel.test.js.snap +++ b/components/Utils/Carousel/__snapshots__/Carousel.test.jsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Carousel should match DOM Snapshot 1`] = ` +exports[`Carousel > should match DOM Snapshot 1`] = `
    { - const mockDropdown = jest.fn(); + const mockDropdown = vi.fn(); const title = 'pizzas'; beforeEach(() => {}); const names = ['foo', 'bar']; diff --git a/__tests__/Utils/__snapshots__/Dropdown.test.js.snap b/components/Utils/Dropdown/__snapshots__/Dropdown.test.jsx.snap similarity index 94% rename from __tests__/Utils/__snapshots__/Dropdown.test.js.snap rename to components/Utils/Dropdown/__snapshots__/Dropdown.test.jsx.snap index 27401d7a3..2e5388490 100644 --- a/__tests__/Utils/__snapshots__/Dropdown.test.js.snap +++ b/components/Utils/Dropdown/__snapshots__/Dropdown.test.jsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Dropdown should match DOM Snapshot 1`] = ` +exports[`Dropdown > should match DOM Snapshot 1`] = `
    { // Hooks diff --git a/components/Utils/GnosisWarning/index.js b/components/Utils/GnosisWarning/index.jsx similarity index 100% rename from components/Utils/GnosisWarning/index.js rename to components/Utils/GnosisWarning/index.jsx diff --git a/components/Utils/HtmlReneder.js b/components/Utils/HtmlReneder.jsx similarity index 100% rename from components/Utils/HtmlReneder.js rename to components/Utils/HtmlReneder.jsx diff --git a/__tests__/Utils/Jazzicon.test.js b/components/Utils/Jazzicon/Jazzicon.test.jsx similarity index 84% rename from __tests__/Utils/Jazzicon.test.js rename to components/Utils/Jazzicon/Jazzicon.test.jsx index 4bd142401..d977ff11d 100755 --- a/__tests__/Utils/Jazzicon.test.js +++ b/components/Utils/Jazzicon/Jazzicon.test.jsx @@ -1,8 +1,8 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import Jazzicon from '../../components/Utils/Jazzicon'; +import Jazzicon from '.'; import renderer from 'react-test-renderer'; // Test cases for full balances, empty balances, and undefined balances. diff --git a/__tests__/Utils/__snapshots__/Jazzicon.test.js.snap b/components/Utils/Jazzicon/__snapshots__/Jazzicon.test.jsx.snap similarity index 86% rename from __tests__/Utils/__snapshots__/Jazzicon.test.js.snap rename to components/Utils/Jazzicon/__snapshots__/Jazzicon.test.jsx.snap index 5b789ff4a..5dce5a6c7 100644 --- a/__tests__/Utils/__snapshots__/Jazzicon.test.js.snap +++ b/components/Utils/Jazzicon/__snapshots__/Jazzicon.test.jsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Jazzicon should match DOM Snapshot 1`] = ` +exports[`Jazzicon > should match DOM Snapshot 1`] = `
    { const iconWrapper = useRef(); diff --git a/__tests__/Utils/LinkDropdown.test.js b/components/Utils/LinkDropdown/LinkDropdown.test.jsx similarity index 82% rename from __tests__/Utils/LinkDropdown.test.js rename to components/Utils/LinkDropdown/LinkDropdown.test.jsx index ee5c943e5..b25fc3f4f 100755 --- a/__tests__/Utils/LinkDropdown.test.js +++ b/components/Utils/LinkDropdown/LinkDropdown.test.jsx @@ -1,8 +1,8 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import LinkDropdown from '../../components/Utils/LinkDropdown'; +import LinkDropdown from '.'; import renderer from 'react-test-renderer'; describe('LinkDropdown', () => { diff --git a/__tests__/Utils/__snapshots__/LinkDropdown.test.js.snap b/components/Utils/LinkDropdown/__snapshots__/LinkDropdown.test.jsx.snap similarity index 96% rename from __tests__/Utils/__snapshots__/LinkDropdown.test.js.snap rename to components/Utils/LinkDropdown/__snapshots__/LinkDropdown.test.jsx.snap index 731db94d0..baf1b1bb3 100644 --- a/__tests__/Utils/__snapshots__/LinkDropdown.test.js.snap +++ b/components/Utils/LinkDropdown/__snapshots__/LinkDropdown.test.jsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`LinkDropdown should match DOM Snapshot: and should display LinkDropdown 1`] = ` +exports[`LinkDropdown > should match DOM Snapshot > and should display LinkDropdown 1`] = `
    should match DOM Snapshot 1`] = `
    { const modal = useRef(); diff --git a/components/Utils/ModalLarge.js b/components/Utils/ModalLarge.jsx similarity index 100% rename from components/Utils/ModalLarge.js rename to components/Utils/ModalLarge.jsx diff --git a/components/Utils/NoSSR.js b/components/Utils/NoSSR.jsx similarity index 100% rename from components/Utils/NoSSR.js rename to components/Utils/NoSSR.jsx diff --git a/components/Utils/OnlyIfAccountPresent.js b/components/Utils/OnlyIfAccountPresent.jsx similarity index 100% rename from components/Utils/OnlyIfAccountPresent.js rename to components/Utils/OnlyIfAccountPresent.jsx diff --git a/components/Utils/PaginatedList/index.js b/components/Utils/PaginatedList/index.jsx similarity index 100% rename from components/Utils/PaginatedList/index.js rename to components/Utils/PaginatedList/index.jsx diff --git a/__tests__/Utils/SmallToggle.test.js b/components/Utils/SmallToggle/SmallToggle.test.jsx similarity index 83% rename from __tests__/Utils/SmallToggle.test.js rename to components/Utils/SmallToggle/SmallToggle.test.jsx index bd3ea6fb5..611c236a9 100644 --- a/__tests__/Utils/SmallToggle.test.js +++ b/components/Utils/SmallToggle/SmallToggle.test.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import SmallToggle from '../../components/Utils/SmallToggle'; +import SmallToggle from '.'; import renderer from 'react-test-renderer'; const names = ['Ready for work', 'All issues']; diff --git a/__tests__/Utils/__snapshots__/SmallToggle.test.js.snap b/components/Utils/SmallToggle/__snapshots__/SmallToggle.test.jsx.snap similarity index 79% rename from __tests__/Utils/__snapshots__/SmallToggle.test.js.snap rename to components/Utils/SmallToggle/__snapshots__/SmallToggle.test.jsx.snap index a39ab155f..7b9a8d234 100644 --- a/__tests__/Utils/__snapshots__/SmallToggle.test.js.snap +++ b/components/Utils/SmallToggle/__snapshots__/SmallToggle.test.jsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`SmallToggle should atch DOM Snapshot 1`] = ` +exports[`SmallToggle > should atch DOM Snapshot 1`] = `
    diff --git a/components/Utils/SmallToggle.js b/components/Utils/SmallToggle/index.jsx similarity index 100% rename from components/Utils/SmallToggle.js rename to components/Utils/SmallToggle/index.jsx diff --git a/__tests__/Utils/Submenu.test.js b/components/Utils/SubMenu/Submenu.test.jsx similarity index 85% rename from __tests__/Utils/Submenu.test.js rename to components/Utils/SubMenu/Submenu.test.jsx index 336de25f7..13d6ddd9a 100755 --- a/__tests__/Utils/Submenu.test.js +++ b/components/Utils/SubMenu/Submenu.test.jsx @@ -1,17 +1,17 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import { render, screen } from '../../test-utils'; -import SubMenu from '../../components/Utils/SubMenu'; +import { render, screen } from '../../../test-utils'; +import SubMenu from '.'; import userEvent from '@testing-library/user-event'; -import Add from '../../components/svg/add.js'; +import Add from '../../svg/add'; import renderer from 'react-test-renderer'; // Test cases for full balances, empty balances, and undefined balances. describe('SubMenu', () => { // Test cases for - const mockUpdatePage = jest.fn(); + const mockUpdatePage = vi.fn(); beforeEach(() => {}); const items = [ { name: 'View', SVG: Add }, diff --git a/__tests__/Utils/__snapshots__/Submenu.test.js.snap b/components/Utils/SubMenu/__snapshots__/Submenu.test.jsx.snap similarity index 91% rename from __tests__/Utils/__snapshots__/Submenu.test.js.snap rename to components/Utils/SubMenu/__snapshots__/Submenu.test.jsx.snap index c54a803f0..eb11bcd9c 100644 --- a/__tests__/Utils/__snapshots__/Submenu.test.js.snap +++ b/components/Utils/SubMenu/__snapshots__/Submenu.test.jsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`SubMenu should match DOM Snapshot and match horizontal style 1`] = ` +exports[`SubMenu > should match DOM Snapshot and match horizontal style 1`] = `
    @@ -43,7 +43,7 @@ exports[`SubMenu should match DOM Snapshot and match horizontal style 1`] = `
    `; -exports[`SubMenu should match DOM Snapshot and match vertical style 1`] = ` +exports[`SubMenu > should match DOM Snapshot and match vertical style 1`] = `
    diff --git a/components/Utils/SubMenu.js b/components/Utils/SubMenu/index.jsx similarity index 100% rename from components/Utils/SubMenu.js rename to components/Utils/SubMenu/index.jsx diff --git a/components/Utils/Subscribe.js b/components/Utils/Subscribe.jsx similarity index 100% rename from components/Utils/Subscribe.js rename to components/Utils/Subscribe.jsx diff --git a/__tests__/Utils/Toggle.test.js b/components/Utils/Toggle/Toggle.test.jsx similarity index 87% rename from __tests__/Utils/Toggle.test.js rename to components/Utils/Toggle/Toggle.test.jsx index 2cc0949a7..a8c585baa 100755 --- a/__tests__/Utils/Toggle.test.js +++ b/components/Utils/Toggle/Toggle.test.jsx @@ -1,16 +1,16 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import { render, screen } from '../../test-utils'; -import Toggle from '../../components/Utils/Toggle'; +import { render, screen } from '../../../test-utils'; +import Toggle from '.'; import userEvent from '@testing-library/user-event'; import renderer from 'react-test-renderer'; // Test cases for full balances, empty balances, and undefined balances. describe('Toggle', () => { // Test cases for - const mockToggle = jest.fn(); + const mockToggle = vi.fn(); const names = ['foo', 'bar']; it('should match DOM Snapshot & foo should have class bg-[#21262d] while bar should not', () => { diff --git a/__tests__/Utils/__snapshots__/Toggle.test.js.snap b/components/Utils/Toggle/__snapshots__/Toggle.test.jsx.snap similarity index 76% rename from __tests__/Utils/__snapshots__/Toggle.test.js.snap rename to components/Utils/Toggle/__snapshots__/Toggle.test.jsx.snap index 63649069a..28a4aa3ce 100644 --- a/__tests__/Utils/__snapshots__/Toggle.test.js.snap +++ b/components/Utils/Toggle/__snapshots__/Toggle.test.jsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Toggle should match DOM Snapshot & foo should have class bg-[#21262d] while bar should not 1`] = ` +exports[`Toggle > should match DOM Snapshot & foo should have class bg-[#21262d] while bar should not 1`] = `
    @@ -23,7 +23,7 @@ exports[`Toggle should match DOM Snapshot & foo should have class bg-[#21262d] w
    `; -exports[`Toggle should match DOM Snapshot & foo should not have class bg-[#21262d] while bar should 1`] = ` +exports[`Toggle > should match DOM Snapshot & foo should not have class bg-[#21262d] while bar should 1`] = `
    diff --git a/components/Utils/Toggle.js b/components/Utils/Toggle/index.jsx similarity index 100% rename from components/Utils/Toggle.js rename to components/Utils/Toggle/index.jsx diff --git a/__tests__/Utils/TooltipNew.test.js b/components/Utils/ToolTipNew/TooltipNew.test.jsx similarity index 90% rename from __tests__/Utils/TooltipNew.test.js rename to components/Utils/ToolTipNew/TooltipNew.test.jsx index fca0a9bba..7ba4b8b35 100755 --- a/__tests__/Utils/TooltipNew.test.js +++ b/components/Utils/ToolTipNew/TooltipNew.test.jsx @@ -1,8 +1,8 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import ToolTipNew from '../../components/Utils/ToolTipNew'; +import ToolTipNew from '.'; import renderer from 'react-test-renderer'; // Test cases for full balances, empty balances, and undefined balances. const Child = () => { diff --git a/__tests__/Utils/__snapshots__/TooltipNew.test.js.snap b/components/Utils/ToolTipNew/__snapshots__/TooltipNew.test.jsx.snap similarity index 69% rename from __tests__/Utils/__snapshots__/TooltipNew.test.js.snap rename to components/Utils/ToolTipNew/__snapshots__/TooltipNew.test.jsx.snap index 076a97612..6e9ddbe8d 100644 --- a/__tests__/Utils/__snapshots__/TooltipNew.test.js.snap +++ b/components/Utils/ToolTipNew/__snapshots__/TooltipNew.test.jsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`ToolTipNew should match DOM Snapshot & display tooltip with styles 1`] = ` +exports[`ToolTipNew > should match DOM Snapshot & display tooltip with styles 1`] = `
    @@ -28,4 +28,4 @@ exports[`ToolTipNew should match DOM Snapshot & display tooltip with styles 1`]
    `; -exports[`ToolTipNew should match DOM Snapshot & hide tooltip 1`] = `
    `; +exports[`ToolTipNew > should match DOM Snapshot & hide tooltip 1`] = `
    `; diff --git a/components/Utils/ToolTipNew.js b/components/Utils/ToolTipNew/index.jsx similarity index 100% rename from components/Utils/ToolTipNew.js rename to components/Utils/ToolTipNew/index.jsx diff --git a/__tests__/Utils/TweetAbout.test.js b/components/Utils/TweetAbout/TweetAbout.test.jsx similarity index 76% rename from __tests__/Utils/TweetAbout.test.js rename to components/Utils/TweetAbout/TweetAbout.test.jsx index f5b518bc8..e75aa8a13 100644 --- a/__tests__/Utils/TweetAbout.test.js +++ b/components/Utils/TweetAbout/TweetAbout.test.jsx @@ -1,7 +1,7 @@ import React from 'react'; -import TweetAbout from '../../components/Utils/TweetAbout'; +import TweetAbout from '.'; import renderer from 'react-test-renderer'; -import Constants from '../../test-utils/constant'; +import Constants from '../../../test-utils/constant'; describe('TweetAbout', () => { const bounty = Constants.bounty; diff --git a/__tests__/Utils/__snapshots__/TweetAbout.test.js.snap b/components/Utils/TweetAbout/__snapshots__/TweetAbout.test.jsx.snap similarity index 92% rename from __tests__/Utils/__snapshots__/TweetAbout.test.js.snap rename to components/Utils/TweetAbout/__snapshots__/TweetAbout.test.jsx.snap index 0555cfd90..01109d9d1 100644 --- a/__tests__/Utils/__snapshots__/TweetAbout.test.js.snap +++ b/components/Utils/TweetAbout/__snapshots__/TweetAbout.test.jsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`TweetAbout should match DOM Snapshot 1`] = ` +exports[`TweetAbout > should match DOM Snapshot 1`] = ` { return ( diff --git a/__tests__/Utils/UnexpectedErrorModal.test.js b/components/Utils/UnexpectedErrorModal/UnexpectedErrorModal.test.jsx similarity index 82% rename from __tests__/Utils/UnexpectedErrorModal.test.js rename to components/Utils/UnexpectedErrorModal/UnexpectedErrorModal.test.jsx index 0e08f6222..466eb6157 100755 --- a/__tests__/Utils/UnexpectedErrorModal.test.js +++ b/components/Utils/UnexpectedErrorModal/UnexpectedErrorModal.test.jsx @@ -1,9 +1,9 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import { render, screen } from '../../test-utils'; -import UnexpectedErrorModal from '../../components/Utils/UnexpectedErrorModal'; +import { render, screen } from '../../../test-utils'; +import UnexpectedErrorModal from '.'; import nextRouter from 'next/router'; // Test cases for full balances, empty balances, and undefined balances. @@ -11,22 +11,22 @@ describe('Error Modal', () => { // Test cases for let push; beforeEach(() => { - push = jest.fn(() => { - return { catch: jest.fn }; + push = vi.fn(() => { + return { catch: vi.fn }; }); process.env.BASE_URL = 'http://localhost:3000'; - const observe = jest.fn(); - const disconnect = jest.fn(); - window.IntersectionObserver = jest.fn(() => ({ + const observe = vi.fn(); + const disconnect = vi.fn(); + window.IntersectionObserver = vi.fn(() => ({ observe, disconnect, })); - nextRouter.useRouter = jest.fn(); + nextRouter.useRouter = vi.fn(); nextRouter.useRouter.mockImplementation(() => ({ query: { type: null }, - prefetch: jest.fn(() => { - return { catch: jest.fn }; + prefetch: vi.fn(() => { + return { catch: vi.fn }; }), push, })); diff --git a/components/Utils/UnexpectedErrorModal.js b/components/Utils/UnexpectedErrorModal/index.jsx similarity index 94% rename from components/Utils/UnexpectedErrorModal.js rename to components/Utils/UnexpectedErrorModal/index.jsx index a95bcdfa7..c6e62e72c 100755 --- a/components/Utils/UnexpectedErrorModal.js +++ b/components/Utils/UnexpectedErrorModal/index.jsx @@ -1,9 +1,9 @@ import React, { useContext } from 'react'; -import ModalDefault from './ModalDefault'; +import ModalDefault from '../ModalDefault'; import { useRouter } from 'next/router'; import Image from 'next/image'; -import GithubSignIn from '../Authentication/GithubSignIn'; -import StoreContext from '../../store/Store/StoreContext'; +import GithubSignIn from '../../Authentication/GithubSignIn'; +import StoreContext from '../../../store/Store/StoreContext'; const UnexpectedErrorModal = ({ error, closeModal }) => { let currentError = ''; diff --git a/components/Utils/__snapshots__/Carousel.test.jsx.snap b/components/Utils/__snapshots__/Carousel.test.jsx.snap new file mode 100644 index 000000000..2c54ec060 --- /dev/null +++ b/components/Utils/__snapshots__/Carousel.test.jsx.snap @@ -0,0 +1,13 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`Carousel > should match DOM Snapshot 1`] = ` +
    +
    +
    +`; diff --git a/components/Utils/__snapshots__/LinkDropdown.test.jsx.snap b/components/Utils/__snapshots__/LinkDropdown.test.jsx.snap new file mode 100644 index 000000000..baf1b1bb3 --- /dev/null +++ b/components/Utils/__snapshots__/LinkDropdown.test.jsx.snap @@ -0,0 +1,79 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`LinkDropdown > should match DOM Snapshot > and should display LinkDropdown 1`] = ` +
    +`; diff --git a/__tests__/WalletConnect/AccountModal.test.js b/components/WalletConnect/AccountModal/AccountModal.test.jsx similarity index 71% rename from __tests__/WalletConnect/AccountModal.test.js rename to components/WalletConnect/AccountModal/AccountModal.test.jsx index 53b79b243..8757258cf 100755 --- a/__tests__/WalletConnect/AccountModal.test.js +++ b/components/WalletConnect/AccountModal/AccountModal.test.jsx @@ -1,34 +1,34 @@ -// test/component/WatchButton/WatchButton.test.js +// test/component/WatchButton/WatchButton.test /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import { render, screen } from '../../test-utils'; -import AccountModal from '../../components/WalletConnect/AccountModal'; +import { render, screen } from '../../../test-utils'; +import AccountModal from '.'; import nextRouter from 'next/router'; // Test cases for full balances, empty balances, and undefined balances. -const setIsConnecting = jest.fn(); +const setIsConnecting = vi.fn(); describe('AccountModal', () => { // Test cases for - const push = jest.fn(() => { - return { catch: jest.fn }; + const push = vi.fn(() => { + return { catch: vi.fn }; }); beforeEach(() => { - const observe = jest.fn(); - const disconnect = jest.fn(); - window.IntersectionObserver = jest.fn(() => ({ + const observe = vi.fn(); + const disconnect = vi.fn(); + window.IntersectionObserver = vi.fn(() => ({ observe, disconnect, })); - nextRouter.useRouter = jest.fn(); + nextRouter.useRouter = vi.fn(); nextRouter.useRouter.mockImplementation(() => ({ query: { type: null }, - prefetch: jest.fn(() => { - return { catch: jest.fn }; + prefetch: vi.fn(() => { + return { catch: vi.fn }; }), push, })); diff --git a/components/WalletConnect/AccountModal.js b/components/WalletConnect/AccountModal/index.jsx similarity index 86% rename from components/WalletConnect/AccountModal.js rename to components/WalletConnect/AccountModal/index.jsx index 14f05a4cf..80f57c1ce 100755 --- a/components/WalletConnect/AccountModal.js +++ b/components/WalletConnect/AccountModal/index.jsx @@ -1,13 +1,13 @@ // Third party import React, { useContext } from 'react'; // Custom -import chainIdDeployEnvMap from './chainIdDeployEnvMap'; -import CopyAddressToClipboard from '../CopyAddressToClipboard'; +import chainIdDeployEnvMap from '../chainIdDeployEnvMap'; +import CopyAddressToClipboard from '../../CopyAddressToClipboard'; import { SignOutIcon } from '@primer/octicons-react'; -import StoreContext from '../../store/Store/StoreContext'; -import { metaMask, walletConnect, coinbaseWallet } from '../WalletConnect/connectors'; -import useWeb3 from '../../hooks/useWeb3'; -import useEns from '../../hooks/useENS'; +import StoreContext from '../../../store/Store/StoreContext'; +import { metaMask, walletConnect, coinbaseWallet } from '../../WalletConnect/connectors'; +import useWeb3 from '../../../hooks/useWeb3'; +import useEns from '../../../hooks/useENS'; const AccountModal = ({ setIsConnecting, domRef, showModal }) => { const { chainId, account, safe } = useWeb3(); diff --git a/__tests__/WalletConnect/ConnectButton.test.js b/components/WalletConnect/ConnectButton/ConnectButton.test.jsx similarity index 59% rename from __tests__/WalletConnect/ConnectButton.test.js rename to components/WalletConnect/ConnectButton/ConnectButton.test.jsx index 464c87b99..ebc1d60a5 100755 --- a/__tests__/WalletConnect/ConnectButton.test.js +++ b/components/WalletConnect/ConnectButton/ConnectButton.test.jsx @@ -1,31 +1,31 @@ /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import { render, screen } from '../../test-utils'; -import ConnectButton from '../../components/WalletConnect/ConnectButton'; +import { render, screen } from '../../../test-utils'; +import ConnectButton from '.'; import nextRouter from 'next/router'; // Test cases for full balances, empty balances, and undefined balances. describe('ConnectButton', () => { // Test cases for - const push = jest.fn(() => { - return { catch: jest.fn }; + const push = vi.fn(() => { + return { catch: vi.fn }; }); beforeEach(() => { - const observe = jest.fn(); - const disconnect = jest.fn(); - window.IntersectionObserver = jest.fn(() => ({ + const observe = vi.fn(); + const disconnect = vi.fn(); + window.IntersectionObserver = vi.fn(() => ({ observe, disconnect, })); - nextRouter.useRouter = jest.fn(); + nextRouter.useRouter = vi.fn(); nextRouter.useRouter.mockImplementation(() => ({ query: { type: null }, - prefetch: jest.fn(() => { - return { catch: jest.fn }; + prefetch: vi.fn(() => { + return { catch: vi.fn }; }), push, })); diff --git a/components/WalletConnect/ConnectButton.js b/components/WalletConnect/ConnectButton/index.jsx similarity index 92% rename from components/WalletConnect/ConnectButton.js rename to components/WalletConnect/ConnectButton/index.jsx index ace1dd6d8..9c33985d2 100755 --- a/components/WalletConnect/ConnectButton.js +++ b/components/WalletConnect/ConnectButton/index.jsx @@ -2,20 +2,20 @@ import React, { useState, useEffect, useRef, useContext } from 'react'; import jazzicon from '@metamask/jazzicon'; // Custom -import useWeb3 from '../../hooks/useWeb3'; -import useConnectOnLoad from '../../hooks/useConnectOnLoad'; -import chainIdDeployEnvMap from './chainIdDeployEnvMap'; -import AccountModal from './AccountModal'; +import useWeb3 from '../../../hooks/useWeb3'; +import useConnectOnLoad from '../../../hooks/useConnectOnLoad'; +import chainIdDeployEnvMap from '../chainIdDeployEnvMap'; +import AccountModal from '../AccountModal'; -import ConnectModal from './ConnectModal'; -import useIsOnCorrectNetwork from '../../hooks/useIsOnCorrectNetwork'; -import StoreContext from '../../store/Store/StoreContext'; -import AuthContext from '../../store/AuthStore/AuthContext'; -import ToolTipNew from '../Utils/ToolTipNew'; +import ConnectModal from '../ConnectModal'; +import useIsOnCorrectNetwork from '../../../hooks/useIsOnCorrectNetwork'; +import StoreContext from '../../../store/Store/StoreContext'; +import AuthContext from '../../../store/AuthStore/AuthContext'; +import ToolTipNew from '../../Utils/ToolTipNew'; import Image from 'next/image'; -import Signup from '../Authentication/Signup'; -import LogIn from '../Authentication/LogIn'; -import ProfileModal from './ProfileModal'; +import Signup from '../../Authentication/Signup'; +import LogIn from '../../Authentication/LogIn'; +import ProfileModal from '../ProfileModal'; // import axios from 'axios'; const ConnectButton = ({ needsGithub, nav, tooltipAction, centerStyles }) => { diff --git a/__tests__/WalletConnect/ConnectModal.test.js b/components/WalletConnect/ConnectModal/ConnectModal.test.jsx similarity index 58% rename from __tests__/WalletConnect/ConnectModal.test.js rename to components/WalletConnect/ConnectModal/ConnectModal.test.jsx index 19a74df52..669dafbf9 100755 --- a/__tests__/WalletConnect/ConnectModal.test.js +++ b/components/WalletConnect/ConnectModal/ConnectModal.test.jsx @@ -1,10 +1,10 @@ -// test/component/WatchButton/WatchButton.test.js +// test/component/WatchButton/WatchButton.test /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import ConnectModal from '../../components/WalletConnect/ConnectModal'; -import { render } from '../../test-utils'; +import ConnectModal from '.'; +import { render } from '../../../test-utils'; describe('ConnectModal', () => { it('should render match DOM Snapshot', () => { diff --git a/__tests__/WalletConnect/__snapshots__/ConnectModal.test.js.snap b/components/WalletConnect/ConnectModal/__snapshots__/ConnectModal.test.jsx.snap similarity index 97% rename from __tests__/WalletConnect/__snapshots__/ConnectModal.test.js.snap rename to components/WalletConnect/ConnectModal/__snapshots__/ConnectModal.test.jsx.snap index 1d6d338b2..7d65685b2 100644 --- a/__tests__/WalletConnect/__snapshots__/ConnectModal.test.js.snap +++ b/components/WalletConnect/ConnectModal/__snapshots__/ConnectModal.test.jsx.snap @@ -1,6 +1,6 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`ConnectModal should render match DOM Snapshot 1`] = ` +exports[`ConnectModal > should render match DOM Snapshot 1`] = `
    { const { account } = useWeb3(); diff --git a/__tests__/WalletConnect/ProfileModal.test.js b/components/WalletConnect/ProfileModal/ProfileModal.test.jsx similarity index 66% rename from __tests__/WalletConnect/ProfileModal.test.js rename to components/WalletConnect/ProfileModal/ProfileModal.test.jsx index 4b8a6e4e6..b0de0970c 100644 --- a/__tests__/WalletConnect/ProfileModal.test.js +++ b/components/WalletConnect/ProfileModal/ProfileModal.test.jsx @@ -1,34 +1,34 @@ // test/component/WatchButton/WatchButton.test.js /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import { render, screen } from '../../test-utils'; -import ProfileModal from '../../components/WalletConnect/ProfileModal'; +import { render, screen } from '../../../test-utils'; +import ProfileModal from '.'; import nextRouter from 'next/router'; -import Constants from '../../test-utils/constant'; +import Constants from '../../../test-utils/constant'; // Test cases for full balances, empty balances, and undefined balances. describe('AccountModal', () => { // Test cases for - const setIsConnecting = jest.fn(); - const push = jest.fn(() => { - return { catch: jest.fn }; + const setIsConnecting = vi.fn(); + const push = vi.fn(() => { + return { catch: vi.fn }; }); beforeEach(() => { - const observe = jest.fn(); - const disconnect = jest.fn(); - window.IntersectionObserver = jest.fn(() => ({ + const observe = vi.fn(); + const disconnect = vi.fn(); + window.IntersectionObserver = vi.fn(() => ({ observe, disconnect, })); - nextRouter.useRouter = jest.fn(); + nextRouter.useRouter = vi.fn(); nextRouter.useRouter.mockImplementation(() => ({ query: { type: null }, - prefetch: jest.fn(() => { - return { catch: jest.fn }; + prefetch: vi.fn(() => { + return { catch: vi.fn }; }), push, })); diff --git a/components/WalletConnect/ProfileModal.js b/components/WalletConnect/ProfileModal/index.jsx similarity index 93% rename from components/WalletConnect/ProfileModal.js rename to components/WalletConnect/ProfileModal/index.jsx index a6cf6b5db..6519dc110 100644 --- a/components/WalletConnect/ProfileModal.js +++ b/components/WalletConnect/ProfileModal/index.jsx @@ -3,9 +3,9 @@ import React, { useContext } from 'react'; import Link from 'next/link'; // Custom import { AlertFillIcon, PersonIcon } from '@primer/octicons-react'; -import StoreContext from '../../store/Store/StoreContext'; -import AuthContext from '../../store/AuthStore/AuthContext'; -import SignOut from '../Authentication/SignOut'; +import StoreContext from '../../../store/Store/StoreContext'; +import AuthContext from '../../../store/AuthStore/AuthContext'; +import SignOut from '../../Authentication/SignOut'; const ProfileModal = ({ domRef, isSafeApp, showModal }) => { const [appState] = useContext(StoreContext); diff --git a/components/WalletConnect/chainIdDeployEnvMap.js b/components/WalletConnect/chainIdDeployEnvMap.jsx similarity index 100% rename from components/WalletConnect/chainIdDeployEnvMap.js rename to components/WalletConnect/chainIdDeployEnvMap.jsx diff --git a/components/WalletConnect/connectors.js b/components/WalletConnect/connectors.jsx similarity index 100% rename from components/WalletConnect/connectors.js rename to components/WalletConnect/connectors.jsx diff --git a/__tests__/WatchButton/WatchButton.test.js b/components/WatchButton/WatchButton/WatchButton.test.jsx similarity index 86% rename from __tests__/WatchButton/WatchButton.test.js rename to components/WatchButton/WatchButton/WatchButton.test.jsx index 6f0585cd8..55afcce7d 100755 --- a/__tests__/WatchButton/WatchButton.test.js +++ b/components/WatchButton/WatchButton/WatchButton.test.jsx @@ -1,12 +1,12 @@ // test/component/WatchButton/WatchButton.test.js /** - * @jest-environment jsdom + * @vi-environment jsdom */ import React from 'react'; -import { render, screen } from '../../test-utils'; +import { render, screen } from '../../../test-utils'; import userEvent from '@testing-library/user-event'; -import WatchButton from '../../components/WatchButton/WatchButton'; -import Constants from '../../test-utils/constant'; +import WatchButton from '.'; +import Constants from '../../../test-utils/constant'; // Test cases for full balances, empty balances, and undefined balances. const bounty = Constants; describe('WatchButton', () => { diff --git a/components/WatchButton/WatchButton.js b/components/WatchButton/WatchButton/index.jsx similarity index 98% rename from components/WatchButton/WatchButton.js rename to components/WatchButton/WatchButton/index.jsx index a74fd9e25..7f7d138d4 100755 --- a/components/WatchButton/WatchButton.js +++ b/components/WatchButton/WatchButton/index.jsx @@ -1,6 +1,6 @@ import React, { useState, useEffect, useContext } from 'react'; -import StoreContext from '../../store/Store/StoreContext'; -import watchBounty from './watchBounty'; +import StoreContext from '../../../store/Store/StoreContext'; +import watchBounty from '../watchBounty'; const WatchButton = ({ setStatefulWatched, unWatchable, watchingState, bounty }) => { const [appState, dispatch] = useContext(StoreContext); diff --git a/components/svg/add.js b/components/svg/add.jsx similarity index 100% rename from components/svg/add.js rename to components/svg/add.jsx diff --git a/components/svg/alert.js b/components/svg/alert.jsx similarity index 100% rename from components/svg/alert.js rename to components/svg/alert.jsx diff --git a/components/svg/chain.js b/components/svg/chain.jsx similarity index 100% rename from components/svg/chain.js rename to components/svg/chain.jsx diff --git a/components/svg/check.js b/components/svg/check.jsx similarity index 100% rename from components/svg/check.js rename to components/svg/check.jsx diff --git a/components/svg/cross.js b/components/svg/cross.jsx similarity index 100% rename from components/svg/cross.js rename to components/svg/cross.jsx diff --git a/components/svg/discord.js b/components/svg/discord.jsx similarity index 100% rename from components/svg/discord.js rename to components/svg/discord.jsx diff --git a/components/svg/exit.js b/components/svg/exit.jsx similarity index 100% rename from components/svg/exit.js rename to components/svg/exit.jsx diff --git a/components/svg/fire.js b/components/svg/fire.jsx similarity index 100% rename from components/svg/fire.js rename to components/svg/fire.jsx diff --git a/components/svg/gear.js b/components/svg/gear.jsx similarity index 100% rename from components/svg/gear.js rename to components/svg/gear.jsx diff --git a/components/svg/github.js b/components/svg/github.jsx similarity index 100% rename from components/svg/github.js rename to components/svg/github.jsx diff --git a/components/svg/home.js b/components/svg/home.jsx similarity index 100% rename from components/svg/home.js rename to components/svg/home.jsx diff --git a/components/svg/linktext.js b/components/svg/linktext.jsx similarity index 100% rename from components/svg/linktext.js rename to components/svg/linktext.jsx diff --git a/components/svg/log.js b/components/svg/log.jsx similarity index 100% rename from components/svg/log.js rename to components/svg/log.jsx diff --git a/components/svg/pencil.js b/components/svg/pencil.jsx similarity index 100% rename from components/svg/pencil.js rename to components/svg/pencil.jsx diff --git a/components/svg/question.js b/components/svg/question.jsx similarity index 100% rename from components/svg/question.js rename to components/svg/question.jsx diff --git a/components/svg/repo.js b/components/svg/repo.jsx similarity index 100% rename from components/svg/repo.js rename to components/svg/repo.jsx diff --git a/components/svg/shieldCheck.js b/components/svg/shieldCheck.jsx similarity index 100% rename from components/svg/shieldCheck.js rename to components/svg/shieldCheck.jsx diff --git a/components/svg/subtract.js b/components/svg/subtract.jsx similarity index 100% rename from components/svg/subtract.js rename to components/svg/subtract.jsx diff --git a/components/svg/telescope.js b/components/svg/telescope.jsx similarity index 100% rename from components/svg/telescope.js rename to components/svg/telescope.jsx diff --git a/components/svg/trophy.js b/components/svg/trophy.jsx similarity index 100% rename from components/svg/trophy.js rename to components/svg/trophy.jsx diff --git a/components/svg/twitter.js b/components/svg/twitter.jsx similarity index 100% rename from components/svg/twitter.js rename to components/svg/twitter.jsx diff --git a/hooks/useAsync.js b/hooks/useAsync.jsx similarity index 100% rename from hooks/useAsync.js rename to hooks/useAsync.jsx diff --git a/hooks/useAuth.js b/hooks/useAuth.jsx similarity index 100% rename from hooks/useAuth.js rename to hooks/useAuth.jsx diff --git a/hooks/useCheckFirstLaunch.js b/hooks/useCheckFirstLaunch.jsx similarity index 100% rename from hooks/useCheckFirstLaunch.js rename to hooks/useCheckFirstLaunch.jsx diff --git a/hooks/useConnectOnLoad.js b/hooks/useConnectOnLoad.jsx similarity index 100% rename from hooks/useConnectOnLoad.js rename to hooks/useConnectOnLoad.jsx diff --git a/hooks/useDisplayValue.js b/hooks/useDisplayValue.jsx similarity index 100% rename from hooks/useDisplayValue.js rename to hooks/useDisplayValue.jsx diff --git a/hooks/useENS.js b/hooks/useENS.jsx similarity index 100% rename from hooks/useENS.js rename to hooks/useENS.jsx diff --git a/hooks/useEagerConnect.js b/hooks/useEagerConnect.jsx similarity index 100% rename from hooks/useEagerConnect.js rename to hooks/useEagerConnect.jsx diff --git a/hooks/useGetTokenValues.js b/hooks/useGetTokenValues.jsx similarity index 100% rename from hooks/useGetTokenValues.js rename to hooks/useGetTokenValues.jsx diff --git a/hooks/useGetValueFromComposite.js b/hooks/useGetValueFromComposite.jsx similarity index 100% rename from hooks/useGetValueFromComposite.js rename to hooks/useGetValueFromComposite.jsx diff --git a/hooks/useIsOnCorrectNetwork.js b/hooks/useIsOnCorrectNetwork.jsx similarity index 100% rename from hooks/useIsOnCorrectNetwork.js rename to hooks/useIsOnCorrectNetwork.jsx diff --git a/hooks/useWeb3.js b/hooks/useWeb3.jsx similarity index 100% rename from hooks/useWeb3.js rename to hooks/useWeb3.jsx diff --git a/lib/UserContext.js b/lib/UserContext.jsx similarity index 100% rename from lib/UserContext.js rename to lib/UserContext.jsx diff --git a/package.json b/package.json index f28da4dfd..581012651 100644 --- a/package.json +++ b/package.json @@ -14,9 +14,10 @@ "start": "next start", "lint": "next lint", "lint:fix": "next lint --fix", - "test": "TZ=UTC jest --watch ", - "test:cicd": "TZ=UTC jest --runInBand", - "test:pre-push": "TZ=UTC jest", + "test": "TZ=UTC NEXT_PUBLIC_DEPLOY_ENV=local vitest watch", + "test:cicd": "TZ=UTC NEXT_PUBLIC_DEPLOY_ENV=local vitest run --threads=false", + "test:pre-push": "TZ=UTC NEXT_PUBLIC_DEPLOY_ENV=local vitest run", + "vitest": "TZ=UTC NEXT_PUBLIC_DEPLOY_ENV=local vitest watch", "gen": "node services/ethers/mocks/abiToJavascriptClass.js", "prepare-mumbai": "mustache constants/config/mumbai.json constants/polygon-mumbai.json.mustache > constants/polygon-mumbai.json && mustache constants/config/mumbai.json constants/polygon-mumbai-tokens.json.mustache > constants/polygon-mumbai-tokens.json", "prepare-polygon": "mustache constants/config/mainnet.json constants/polygon-mainnet.json.mustache > constants/polygon-mainnet.json && mustache constants/config/mainnet.json constants/polygon-mainnet-tokens.json.mustache > constants/polygon-mainnet-tokens.json", @@ -41,6 +42,7 @@ "@tailwindcss/container-queries": "0.1.0", "@testing-library/user-event": "14.4.3", "@types/uuid": "9.0.1", + "@vitejs/plugin-react": "^3.1.0", "@walletconnect/ethereum-provider": "2.4.7", "@walletconnect/utils": "1.8.0", "@walletconnect/web3-provider": "1.8.0", @@ -69,6 +71,7 @@ "graphql-tag": "2.12.6", "jest": "29.5.0", "js-md4": "0.3.2", + "jsdom": "^21.1.1", "json-server": "0.17.2", "jspdf": "2.5.1", "jspdf-autotable": "3.5.28", @@ -95,6 +98,7 @@ "@babel/preset-react": "7.18.6", "@testing-library/jest-dom": "5.16.5", "@testing-library/react": "14.0.0", + "@vitest/ui": "^0.29.8", "autoprefixer": "10.4.14", "babel-jest": "29.5.0", "eslint": "8.36.0", @@ -105,7 +109,8 @@ "jest-junit": "15.0.0", "postcss": "8.4.21", "prettier": "2.8.4", - "tailwindcss": "3.2.7" + "tailwindcss": "3.2.7", + "vitest": "^0.29.8" }, "jest-junit": { "addFileAttribute": "true" diff --git a/pages/auth/github.js b/pages/auth/github.jsx similarity index 100% rename from pages/auth/github.js rename to pages/auth/github.jsx diff --git a/services/coins/MockTokenClient.js b/services/coins/MockTokenClient.js index 12b455db5..48461471b 100755 --- a/services/coins/MockTokenClient.js +++ b/services/coins/MockTokenClient.js @@ -25,9 +25,7 @@ class MockCoinClient { async getTokenValues(data) { const promise = new Promise(async (resolve, reject) => { - await axios - .get('http://localhost:3030/tokenPrice') - .then(async (result) => { + const result = await axios('http://localhost:3030/tokenPrice'); const price = parseFloat(result.data['0x5FbDB2315678afecb367f032d93F642f64180aa']); const tokenValues = { tokenPrices: {}, tokens: {}, total: 0 }; let total = 0; @@ -42,10 +40,7 @@ class MockCoinClient { tokenValues.total = Math.round(parseFloat(total) * 100) / 100; await this.sleep(200); resolve(tokenValues); - }) - .catch((error) => { - reject(error); - }); + }); return promise; } diff --git a/services/ethers/MockOpenQClient.js b/services/ethers/MockOpenQClient.js index 698498bc4..da0cad18c 100755 --- a/services/ethers/MockOpenQClient.js +++ b/services/ethers/MockOpenQClient.js @@ -13,7 +13,17 @@ class MockOpenQClient { this.shouldSleep = time; } - constructor(mockMutations) { this.mockMutations = mockMutations; } + constructor(mockMutations) { + + const initialMockMutations = { + setFundingGoal: () => { }, + setPayout: () => { }, + setSupportingDocumentsComplete: () => { }, + setTier: () => { }, + closeOngoing: () => { }, + } + + this.mockMutations = { ...initialMockMutations,...mockMutations,}; } async sleep(time = this.shouldSleep) { return new Promise(async (resolve) => { @@ -28,7 +38,7 @@ class MockOpenQClient { getENS = async (_callerAddress) => { let promise = new Promise(async (resolve) => { await this.sleep(); - resolve("sample.eth"); + resolve(`${_callerAddress.slice(0,4)}...${_callerAddress.slice(-4)}`); }); return promise; diff --git a/services/github/MockGithubRepository.js b/services/github/MockGithubRepository.js index 6bd371d66..ec92ebf75 100755 --- a/services/github/MockGithubRepository.js +++ b/services/github/MockGithubRepository.js @@ -31,7 +31,8 @@ class MockGithubRepository { return promise; } - async fetchIssueById(issueId) { + async fetchIssueById(issueId="I_kwDOGWnnz85I9Agl") { + console.log(issueId) const promise = new Promise((resolve, reject) => { axios.get(`http://localhost:3030/githubIssues?id=${issueId}`) .then(result => { diff --git a/services/openq-api/MockOpenQPrismaClient.js b/services/openq-api/MockOpenQPrismaClient.js index 252b9b1f7..b8b17e765 100755 --- a/services/openq-api/MockOpenQPrismaClient.js +++ b/services/openq-api/MockOpenQPrismaClient.js @@ -1,7 +1,11 @@ import axios from "axios"; class OpenQPrismaClient { constructor(mockMutations) { - this.mockMutations = mockMutations; + const initialMocks = { + updateUserMockFunc: () => { }, + updateRequest: () => { }, + }; + this.mockMutations = {...initialMocks, ...mockMutations}; } async getPaginatedTVLS(id, startAt, order, first) { diff --git a/services/utils/lib.test.js b/services/utils/lib.test.js index 848eddee6..cacd451ac 100644 --- a/services/utils/lib.test.js +++ b/services/utils/lib.test.js @@ -23,8 +23,8 @@ import Constants from '../../test-utils/constant'; describe('getNonBlacklisted', () => { it('should return an of non-blacklisted repos', async () => { const repoName = Constants.repoName; - const getPrs = jest.fn().mockReturnValue({ repoPrs: [{ id: 'a' }, { id: 'b' }], totalCount: 0 }); - const getSubmissions = jest.fn().mockReturnValue([{ id: 'a', blacklisted: true }]); + const getPrs = vi.fn().mockReturnValue({ repoPrs: [{ id: 'a' }, { id: 'b' }], totalCount: 0 }); + const getSubmissions = vi.fn().mockReturnValue([{ id: 'a', blacklisted: true }]); const githubRepository = { getPrs }; const openQPrismaClient = { getSubmissions }; const mockAppState = { githubRepository, openQPrismaClient }; @@ -413,10 +413,10 @@ describe('fetchRequestsWithServiceArg', () => { nodes: [Constants.request0, Constants.request1], }, }; - const getUserRequests = jest.fn().mockReturnValueOnce({ + const getUserRequests = vi.fn().mockReturnValueOnce({ createdBounties: { bountyConnection: { nodes: [bountyWithRequest, bountyWithRequest] } }, }); - const fetchUserById = jest.fn().mockReturnValueOnce({ + const fetchUserById = vi.fn().mockReturnValueOnce({ user: { github: 'test', id: '0x123', @@ -593,6 +593,7 @@ describe('fetchRequestsWithServiceArg', () => { }, merged: true, mergedAt: '2022-03-28T17:57:44Z', + createdAt: '2022-03-28T17:57:44Z', title: 'Update README.md', url: 'https://github.com/OpenQDev/OpenQ-TestRepo/pull/138', }, diff --git a/store/AuthStore/AuthProvider.js b/store/AuthStore/AuthProvider.jsx similarity index 100% rename from store/AuthStore/AuthProvider.js rename to store/AuthStore/AuthProvider.jsx diff --git a/store/AuthStore/TestAuthProvider.js b/store/AuthStore/TestAuthProvider.jsx similarity index 100% rename from store/AuthStore/TestAuthProvider.js rename to store/AuthStore/TestAuthProvider.jsx diff --git a/store/Store/StoreProvider.js b/store/Store/StoreProvider.jsx similarity index 100% rename from store/Store/StoreProvider.js rename to store/Store/StoreProvider.jsx diff --git a/store/Store/TestStoreProvider.js b/store/Store/TestStoreProvider.jsx similarity index 100% rename from store/Store/TestStoreProvider.js rename to store/Store/TestStoreProvider.jsx diff --git a/tailwind.config.js b/tailwind.config.js index a0b6b7d99..2852808b2 100755 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -3,7 +3,7 @@ /*CHECK DOC ABOUT extensio parameters vs theem*/ module.exports = { mode: 'jit', - content: ['./components/**/*.js', './pages/**/*.js', "./services/utils/Utils.js", "./services/utils/lib.js"], + content: ['./components/**/*.js', './pages/**/*.js', './components/**/*.jsx', './pages/**/*.jsx',"./services/utils/Utils.js", "./services/utils/lib.js"], darkMode: false, // or 'media' or 'class' theme: { extend: { diff --git a/target/npmlist.json b/target/npmlist.json index 4567e8ed7..d04d5068d 100755 --- a/target/npmlist.json +++ b/target/npmlist.json @@ -1 +1 @@ -{"version":"0.1.0","name":"openq","dependencies":{"@apollo/client":{"version":"3.5.9"},"@babel/helper-get-function-arity":{"version":"7.16.7"},"@coinbase/wallet-sdk":{"version":"3.5.4"},"@ethersproject/address":{"version":"5.7.0"},"@ethersproject/bignumber":{"version":"5.7.0"},"@ethersproject/experimental":{"version":"5.7.0"},"@ethersproject/providers":{"version":"5.7.0"},"@ethersproject/units":{"version":"5.7.0"},"@metamask/jazzicon":{"version":"2.0.0"},"@primer/octicons-react":{"version":"17.4.1"},"@react-pdf/renderer":{"version":"2.3.0"},"@superfluid-finance/sdk-core":{"version":"0.4.2"},"@testing-library/user-event":{"version":"14.1.1"},"@walletconnect/ethereum-provider":{"version":"1.8.0"},"@web3-react/core":{"version":"8.0.35-beta.0"},"@web3-react/gnosis-safe":{"version":"8.0.6-beta.0"},"@web3-react/metamask":{"version":"8.0.28-beta.0"},"@web3-react/types":{"version":"6.0.7"},"@web3-react/walletconnect":{"version":"8.0.35-beta.0"},"apollo-link-http":{"version":"1.5.17"},"aria-query":{"version":"4.2.2"},"assert":{"version":"2.0.0"},"axios-cache-adapter":{"version":"2.7.3"},"axios":{"version":"1.1.3"},"bignumber.js":{"version":"9.0.2"},"blob-stream":{"version":"0.1.3"},"browserify-zlib":{"version":"0.2.0"},"buffer":{"version":"6.0.3"},"canvas-confetti":{"version":"1.5.1"},"chai":{"version":"4.3.6"},"cliui":{"version":"7.0.4"},"color-string":{"version":"0.3.0"},"cross-fetch":{"version":"3.1.5"},"d3":{"version":"7.6.1"},"dash-ast":{"version":"1.0.0"},"diff-sequences":{"version":"27.5.1"},"eslint-config-prettier":{"version":"8.5.0"},"eslint-plugin-prettier":{"version":"4.2.1"},"eslint-plugin-unused-imports":{"version":"1.1.5"},"eth-rpc-errors":{"version":"4.0.2"},"ethers":{"version":"5.7.0"},"eventemitter3":{"version":"3.1.2"},"github-markdown-css":{"version":"5.1.0"},"graphql-request":{"version":"3.7.0"},"graphql-tag":{"version":"2.12.6"},"graphql":{"version":"15.8.0"},"hardhat":{"version":"2.8.4"},"jest-diff":{"version":"27.5.1"},"jest-get-type":{"version":"27.5.1"},"jest-matcher-utils":{"version":"27.5.1"},"jest":{"version":"29.2.2"},"json-schema-traverse":{"version":"0.4.1"},"json-server":{"version":"0.17.0"},"json5":{"version":"1.0.1"},"jspdf-autotable":{"version":"3.5.25"},"jspdf":{"version":"2.5.1"},"lodash":{"version":"4.17.21"},"lru-cache":{"version":"5.1.1"},"mustache":{"version":"4.2.0"},"next":{"version":"12.1.6"},"pako":{"version":"1.0.11"},"pretty-format":{"version":"27.5.1"},"process":{"version":"0.11.10"},"raw-body":{"version":"2.5.0"},"react-dom":{"version":"17.0.2"},"react-ga4":{"version":"1.4.1"},"react-hotjar":{"version":"5.2.0"},"react-loading-skeleton":{"version":"3.0.3"},"react-native-url-polyfill":{"version":"1.3.0"},"react-reconciler":{"version":"0.23.0"},"react":{"version":"17.0.2"},"scheduler":{"version":"0.20.2"},"sharp":{"version":"0.30.4"},"stream-browserify":{"version":"3.0.0"},"strip-bom":{"version":"3.0.0"},"styled-jsx":{"version":"5.0.2"},"subscriptions-transport-ws":{"version":"0.11.0"},"tiny-invariant":{"version":"1.3.1"},"util":{"version":"0.12.4"},"yallist":{"version":"3.1.1"}}} \ No newline at end of file +{"version":"0.1.0","name":"openq","dependencies":{"@apollo/client":{"version":"3.5.9"},"@babel/helper-get-function-arity":{"version":"7.16.7"},"@coinbase/wallet-sdk":{"version":"3.5.4"},"@ethersproject/address":{"version":"5.7.0"},"@ethersproject/bignumber":{"version":"5.7.0"},"@ethersproject/experimental":{"version":"5.7.0"},"@ethersproject/providers":{"version":"5.7.0"},"@ethersproject/units":{"version":"5.7.0"},"@metamask/jazzicon":{"version":"2.0.0"},"@primer/octicons-react":{"version":"17.4.1"},"@react-pdf/renderer":{"version":"2.3.0"},"@superfluid-finance/sdk-core":{"version":"0.4.2"},"@testing-library/user-event":{"version":"14.1.1"},"@walletconnect/ethereum-provider":{"version":"1.8.0"},"@web3-react/core":{"version":"8.0.35-beta.0"},"@web3-react/gnosis-safe":{"version":"8.0.6-beta.0"},"@web3-react/metamask":{"version":"8.0.28-beta.0"},"@web3-react/types":{"version":"6.0.7"},"@web3-react/walletconnect":{"version":"8.0.35-beta.0"},"apollo-link-http":{"version":"1.5.17"},"aria-query":{"version":"4.2.2"},"assert":{"version":"2.0.0"},"axios-cache-adapter":{"version":"2.7.3"},"axios":{"version":"1.1.3"},"bignumber.js":{"version":"9.0.2"},"blob-stream":{"version":"0.1.3"},"browserify-zlib":{"version":"0.2.0"},"buffer":{"version":"6.0.3"},"canvas-confetti":{"version":"1.5.1"},"chai":{"version":"4.3.6"},"cliui":{"version":"7.0.4"},"color-string":{"version":"0.3.0"},"cross-fetch":{"version":"3.1.5"},"d3":{"version":"7.6.1"},"dash-ast":{"version":"1.0.0"},"diff-sequences":{"version":"27.5.1"},"eslint-config-prettier":{"version":"8.5.0"},"eslint-plugin-prettier":{"version":"4.2.1"},"eslint-plugin-unused-imports":{"version":"1.1.5"},"eth-rpc-errors":{"version":"4.0.2"},"ethers":{"version":"5.7.0"},"eventemitter3":{"version":"3.1.2"},"github-markdown-css":{"version":"5.1.0"},"graphql-request":{"version":"3.7.0"},"graphql-tag":{"version":"2.12.6"},"graphql":{"version":"15.8.0"},"hardhat":{"version":"2.8.4"},"vi-diff":{"version":"27.5.1"},"vi-get-type":{"version":"27.5.1"},"vi-matcher-utils":{"version":"27.5.1"},"vi":{"version":"29.2.2"},"json-schema-traverse":{"version":"0.4.1"},"json-server":{"version":"0.17.0"},"json5":{"version":"1.0.1"},"jspdf-autotable":{"version":"3.5.25"},"jspdf":{"version":"2.5.1"},"lodash":{"version":"4.17.21"},"lru-cache":{"version":"5.1.1"},"mustache":{"version":"4.2.0"},"next":{"version":"12.1.6"},"pako":{"version":"1.0.11"},"pretty-format":{"version":"27.5.1"},"process":{"version":"0.11.10"},"raw-body":{"version":"2.5.0"},"react-dom":{"version":"17.0.2"},"react-ga4":{"version":"1.4.1"},"react-hotjar":{"version":"5.2.0"},"react-loading-skeleton":{"version":"3.0.3"},"react-native-url-polyfill":{"version":"1.3.0"},"react-reconciler":{"version":"0.23.0"},"react":{"version":"17.0.2"},"scheduler":{"version":"0.20.2"},"sharp":{"version":"0.30.4"},"stream-browserify":{"version":"3.0.0"},"strip-bom":{"version":"3.0.0"},"styled-jsx":{"version":"5.0.2"},"subscriptions-transport-ws":{"version":"0.11.0"},"tiny-invariant":{"version":"1.3.1"},"util":{"version":"0.12.4"},"yallist":{"version":"3.1.1"}}} \ No newline at end of file diff --git a/test-utils/constant.js b/test-utils/constant.js index e0fa1e45b..0b508cf8d 100644 --- a/test-utils/constant.js +++ b/test-utils/constant.js @@ -40,6 +40,7 @@ export default class Constants { }, merged: true, mergedAt: '2022-03-28T17:57:44Z', + createdAt: '2022-03-28T17:57:44Z', title: 'Update README.md', url: 'https://github.com/OpenQDev/OpenQ-TestRepo/pull/138', }; @@ -498,6 +499,7 @@ export default class Constants { source: { __typename: 'PullRequest', mergedAt: '2022-03-28T17:57:44Z', + createdAt: '2022-03-28T17:57:44Z', url: 'https://github.com/OpenQDev/OpenQ-TestRepo/pull/138', id: 'PR_kwDOGWnnz841LGsK', merged: true, @@ -949,6 +951,7 @@ export default class Constants { source: { __typename: 'PullRequest', mergedAt: '2023-01-03T02:53:55Z', + createdAt: '2022-03-28T17:57:44Z', url: 'https://github.com/OpenQDev/OpenQ-TestRepo/pull/793', id: 'PR_kwDOGWnnz85GJi_U', merged: true, diff --git a/test-utils/index.js b/test-utils/index.jsx similarity index 87% rename from test-utils/index.js rename to test-utils/index.jsx index e43afce92..b012ddff6 100755 --- a/test-utils/index.js +++ b/test-utils/index.jsx @@ -12,6 +12,13 @@ import TokenProvider from '../components/TokenSelection/TokenStore/TokenProvider // test-utils.js // (ReduxProvider, ThemeProvider, etc) const customRender = (ui, options = {}, storeProps, authProps) => { + const IntersectionObserverMock = vi.fn(() => ({ + disconnect: vi.fn(), + observe: vi.fn(), + takeRecords: vi.fn(), + unobserve: vi.fn(), + })); + vi.stubGlobal('IntersectionObserver', IntersectionObserverMock); const Providers = ({ children }) => { return ( diff --git a/test-utils/setup.js b/test-utils/setup.js new file mode 100644 index 000000000..b8281ba62 --- /dev/null +++ b/test-utils/setup.js @@ -0,0 +1,12 @@ +import { expect, afterEach } from 'vitest'; +import { cleanup } from '@testing-library/react'; +import matchers from '@testing-library/jest-dom/matchers'; + +expect.extend(matchers); + +afterEach(() => { + cleanup(); + vi.clearAllMocks(); + vi.resetAllMocks(); + vi.useRealTimers(); +}); diff --git a/vitest.config.ts b/vitest.config.ts new file mode 100644 index 000000000..3c5c311cd --- /dev/null +++ b/vitest.config.ts @@ -0,0 +1,15 @@ +import { defineConfig } from 'vite' +import react from '@vitejs/plugin-react' + +export default defineConfig({ + plugins: [react()], + test: { + globals: true, + environment: 'jsdom', + setupFiles: './test-utils/setup.js', + minThreads:1, + maxThreads: 1, + reporters: [ "default",'junit'], + outputFile: 'junit.xml', + } +}) \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index a62377b1a..fd5c985dd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -55,11 +55,23 @@ dependencies: "@babel/highlight" "^7.18.6" +"@babel/code-frame@^7.21.4": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.21.4.tgz#d0fa9e4413aca81f2b23b9442797bda1826edb39" + integrity sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g== + dependencies: + "@babel/highlight" "^7.18.6" + "@babel/compat-data@^7.17.7", "@babel/compat-data@^7.20.1", "@babel/compat-data@^7.20.5": version "7.21.0" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.21.0.tgz#c241dc454e5b5917e40d37e525e2f4530c399298" integrity sha512-gMuZsmsgxk/ENC3O/fRw5QY8A9/uxQbbCEypnLIiYYc/qVJtEV7ouxC3EllIIwNzMqAQee5tanFabWsUOutS7g== +"@babel/compat-data@^7.21.4": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.21.4.tgz#457ffe647c480dff59c2be092fc3acf71195c87f" + integrity sha512-/DYyDpeCfaVinT40FPGdkkb+lYSKvsVuMjDAG7jPOWWiM1ibOaB9CXJAlc4d1QpP/U2q2P9jbrSlClKSErd55g== + "@babel/core@^7.1.0", "@babel/core@^7.11.1", "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.16.0", "@babel/core@^7.7.2", "@babel/core@^7.8.0": version "7.21.0" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.21.0.tgz#1341aefdcc14ccc7553fcc688dd8986a2daffc13" @@ -81,6 +93,27 @@ json5 "^2.2.2" semver "^6.3.0" +"@babel/core@^7.20.12": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.21.4.tgz#c6dc73242507b8e2a27fd13a9c1814f9fa34a659" + integrity sha512-qt/YV149Jman/6AfmlxJ04LMIu8bMoyl3RB91yTFrxQmgbrSvQMy7cI8Q62FHx1t8wJ8B5fu0UDoLwHAhUo1QA== + dependencies: + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.21.4" + "@babel/generator" "^7.21.4" + "@babel/helper-compilation-targets" "^7.21.4" + "@babel/helper-module-transforms" "^7.21.2" + "@babel/helpers" "^7.21.0" + "@babel/parser" "^7.21.4" + "@babel/template" "^7.20.7" + "@babel/traverse" "^7.21.4" + "@babel/types" "^7.21.4" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.2" + semver "^6.3.0" + "@babel/eslint-parser@7.19.1", "@babel/eslint-parser@^7.16.3": version "7.19.1" resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.19.1.tgz#4f68f6b0825489e00a24b41b6a1ae35414ecd2f4" @@ -100,6 +133,16 @@ "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" +"@babel/generator@^7.21.4": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.21.4.tgz#64a94b7448989f421f919d5239ef553b37bb26bc" + integrity sha512-NieM3pVIYW2SwGzKoqfPrQsf4xGs9M9AIG3ThppsSRmO+m7eQhmI6amajKMUeIO37wFfsvnvcxQFx6x6iqxDnA== + dependencies: + "@babel/types" "^7.21.4" + "@jridgewell/gen-mapping" "^0.3.2" + "@jridgewell/trace-mapping" "^0.3.17" + jsesc "^2.5.1" + "@babel/helper-annotate-as-pure@^7.16.0", "@babel/helper-annotate-as-pure@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz#eaa49f6f80d5a33f9a5dd2276e6d6e451be0a6bb" @@ -126,6 +169,17 @@ lru-cache "^5.1.1" semver "^6.3.0" +"@babel/helper-compilation-targets@^7.21.4": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.21.4.tgz#770cd1ce0889097ceacb99418ee6934ef0572656" + integrity sha512-Fa0tTuOXZ1iL8IeDFUWCzjZcn+sJGd9RZdH9esYVjEejGmzf+FFYQpMi/kZUk2kPy/q1H3/GPw7np8qar/stfg== + dependencies: + "@babel/compat-data" "^7.21.4" + "@babel/helper-validator-option" "^7.21.0" + browserslist "^4.21.3" + lru-cache "^5.1.1" + semver "^6.3.0" + "@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.21.0": version "7.21.0" resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.21.0.tgz#64f49ecb0020532f19b1d014b03bccaa1ab85fb9" @@ -318,6 +372,11 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.21.2.tgz#dacafadfc6d7654c3051a66d6fe55b6cb2f2a0b3" integrity sha512-URpaIJQwEkEC2T9Kn+Ai6Xe/02iNaVCuT/PtoRz3GPVJVDpPd7mLo+VddTbhCRU9TXqW5mSrQfXZyi8kDKOVpQ== +"@babel/parser@^7.21.4": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.21.4.tgz#94003fdfc520bbe2875d4ae557b43ddb6d880f17" + integrity sha512-alVJj7k7zIxqBZ7BTRhz0IqJFxW1VJbm6N8JbcYhQ186df9ZBPbZBmWSqAMXwHGsCJdYks7z/voa3ibiS5bCIw== + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz#da5b8f9a580acdfbe53494dba45ea389fb09a4d2" @@ -835,6 +894,20 @@ dependencies: "@babel/plugin-transform-react-jsx" "^7.18.6" +"@babel/plugin-transform-react-jsx-self@^7.18.6": + version "7.21.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.21.0.tgz#ec98d4a9baafc5a1eb398da4cf94afbb40254a54" + integrity sha512-f/Eq+79JEu+KUANFks9UZCcvydOOGMgF7jBrcwjHa5jTZD8JivnhCJYvmlhR/WTXBWonDExPoW0eO/CR4QJirA== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + +"@babel/plugin-transform-react-jsx-source@^7.19.6": + version "7.19.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.19.6.tgz#88578ae8331e5887e8ce28e4c9dc83fb29da0b86" + integrity sha512-RpAi004QyMNisst/pvSanoRdJ4q+jMCWyk9zdw/CyLB9j8RXEahodR6l2GyttDRyEVWZtbN+TpLiHJ3t34LbsQ== + dependencies: + "@babel/helper-plugin-utils" "^7.19.0" + "@babel/plugin-transform-react-jsx@^7.18.6": version "7.21.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.21.0.tgz#656b42c2fdea0a6d8762075d58ef9d4e3c4ab8a2" @@ -1091,6 +1164,22 @@ debug "^4.1.0" globals "^11.1.0" +"@babel/traverse@^7.21.4": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.21.4.tgz#a836aca7b116634e97a6ed99976236b3282c9d36" + integrity sha512-eyKrRHKdyZxqDm+fV1iqL9UAHMoIg0nDaGqfIOd8rKH17m5snv7Gn4qgjBoFfLz9APvjFU/ICT00NVCv1Epp8Q== + dependencies: + "@babel/code-frame" "^7.21.4" + "@babel/generator" "^7.21.4" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-function-name" "^7.21.0" + "@babel/helper-hoist-variables" "^7.18.6" + "@babel/helper-split-export-declaration" "^7.18.6" + "@babel/parser" "^7.21.4" + "@babel/types" "^7.21.4" + debug "^4.1.0" + globals "^11.1.0" + "@babel/types@^7.0.0", "@babel/types@^7.12.6", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.20.0", "@babel/types@^7.20.2", "@babel/types@^7.20.5", "@babel/types@^7.20.7", "@babel/types@^7.21.0", "@babel/types@^7.21.2", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": version "7.21.2" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.21.2.tgz#92246f6e00f91755893c2876ad653db70c8310d1" @@ -1100,6 +1189,15 @@ "@babel/helper-validator-identifier" "^7.19.1" to-fast-properties "^2.0.0" +"@babel/types@^7.21.4": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.21.4.tgz#2d5d6bb7908699b3b416409ffd3b5daa25b030d4" + integrity sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA== + dependencies: + "@babel/helper-string-parser" "^7.19.4" + "@babel/helper-validator-identifier" "^7.19.1" + to-fast-properties "^2.0.0" + "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -1338,6 +1436,116 @@ resolved "https://registry.yarnpkg.com/@ensdomains/resolver/-/resolver-0.2.4.tgz#c10fe28bf5efbf49bff4666d909aed0265efbc89" integrity sha512-bvaTH34PMCbv6anRa9I/0zjLJgY4EuznbEMgbV77JBCQ9KNC46rzi0avuxpOfu+xDjPEtSFGqVEOr5GlUSGudA== +"@esbuild/android-arm64@0.17.15": + version "0.17.15" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.17.15.tgz#893ad71f3920ccb919e1757c387756a9bca2ef42" + integrity sha512-0kOB6Y7Br3KDVgHeg8PRcvfLkq+AccreK///B4Z6fNZGr/tNHX0z2VywCc7PTeWp+bPvjA5WMvNXltHw5QjAIA== + +"@esbuild/android-arm@0.17.15": + version "0.17.15" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.17.15.tgz#143e0d4e4c08c786ea410b9a7739779a9a1315d8" + integrity sha512-sRSOVlLawAktpMvDyJIkdLI/c/kdRTOqo8t6ImVxg8yT7LQDUYV5Rp2FKeEosLr6ZCja9UjYAzyRSxGteSJPYg== + +"@esbuild/android-x64@0.17.15": + version "0.17.15" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.17.15.tgz#d2d12a7676b2589864281b2274355200916540bc" + integrity sha512-MzDqnNajQZ63YkaUWVl9uuhcWyEyh69HGpMIrf+acR4otMkfLJ4sUCxqwbCyPGicE9dVlrysI3lMcDBjGiBBcQ== + +"@esbuild/darwin-arm64@0.17.15": + version "0.17.15" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.17.15.tgz#2e88e79f1d327a2a7d9d06397e5232eb0a473d61" + integrity sha512-7siLjBc88Z4+6qkMDxPT2juf2e8SJxmsbNVKFY2ifWCDT72v5YJz9arlvBw5oB4W/e61H1+HDB/jnu8nNg0rLA== + +"@esbuild/darwin-x64@0.17.15": + version "0.17.15" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.17.15.tgz#9384e64c0be91388c57be6d3a5eaf1c32a99c91d" + integrity sha512-NbImBas2rXwYI52BOKTW342Tm3LTeVlaOQ4QPZ7XuWNKiO226DisFk/RyPk3T0CKZkKMuU69yOvlapJEmax7cg== + +"@esbuild/freebsd-arm64@0.17.15": + version "0.17.15" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.15.tgz#2ad5a35bc52ebd9ca6b845dbc59ba39647a93c1a" + integrity sha512-Xk9xMDjBVG6CfgoqlVczHAdJnCs0/oeFOspFap5NkYAmRCT2qTn1vJWA2f419iMtsHSLm+O8B6SLV/HlY5cYKg== + +"@esbuild/freebsd-x64@0.17.15": + version "0.17.15" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.17.15.tgz#b513a48446f96c75fda5bef470e64d342d4379cd" + integrity sha512-3TWAnnEOdclvb2pnfsTWtdwthPfOz7qAfcwDLcfZyGJwm1SRZIMOeB5FODVhnM93mFSPsHB9b/PmxNNbSnd0RQ== + +"@esbuild/linux-arm64@0.17.15": + version "0.17.15" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.17.15.tgz#9697b168175bfd41fa9cc4a72dd0d48f24715f31" + integrity sha512-T0MVnYw9KT6b83/SqyznTs/3Jg2ODWrZfNccg11XjDehIved2oQfrX/wVuev9N936BpMRaTR9I1J0tdGgUgpJA== + +"@esbuild/linux-arm@0.17.15": + version "0.17.15" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.17.15.tgz#5b22062c54f48cd92fab9ffd993732a52db70cd3" + integrity sha512-MLTgiXWEMAMr8nmS9Gigx43zPRmEfeBfGCwxFQEMgJ5MC53QKajaclW6XDPjwJvhbebv+RzK05TQjvH3/aM4Xw== + +"@esbuild/linux-ia32@0.17.15": + version "0.17.15" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.17.15.tgz#eb28a13f9b60b5189fcc9e98e1024f6b657ba54c" + integrity sha512-wp02sHs015T23zsQtU4Cj57WiteiuASHlD7rXjKUyAGYzlOKDAjqK6bk5dMi2QEl/KVOcsjwL36kD+WW7vJt8Q== + +"@esbuild/linux-loong64@0.17.15": + version "0.17.15" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.17.15.tgz#32454bdfe144cf74b77895a8ad21a15cb81cfbe5" + integrity sha512-k7FsUJjGGSxwnBmMh8d7IbObWu+sF/qbwc+xKZkBe/lTAF16RqxRCnNHA7QTd3oS2AfGBAnHlXL67shV5bBThQ== + +"@esbuild/linux-mips64el@0.17.15": + version "0.17.15" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.17.15.tgz#af12bde0d775a318fad90eb13a0455229a63987c" + integrity sha512-ZLWk6czDdog+Q9kE/Jfbilu24vEe/iW/Sj2d8EVsmiixQ1rM2RKH2n36qfxK4e8tVcaXkvuV3mU5zTZviE+NVQ== + +"@esbuild/linux-ppc64@0.17.15": + version "0.17.15" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.17.15.tgz#34c5ed145b2dfc493d3e652abac8bd3baa3865a5" + integrity sha512-mY6dPkIRAiFHRsGfOYZC8Q9rmr8vOBZBme0/j15zFUKM99d4ILY4WpOC7i/LqoY+RE7KaMaSfvY8CqjJtuO4xg== + +"@esbuild/linux-riscv64@0.17.15": + version "0.17.15" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.17.15.tgz#87bd515e837f2eb004b45f9e6a94dc5b93f22b92" + integrity sha512-EcyUtxffdDtWjjwIH8sKzpDRLcVtqANooMNASO59y+xmqqRYBBM7xVLQhqF7nksIbm2yHABptoioS9RAbVMWVA== + +"@esbuild/linux-s390x@0.17.15": + version "0.17.15" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.17.15.tgz#20bf7947197f199ddac2ec412029a414ceae3aa3" + integrity sha512-BuS6Jx/ezxFuHxgsfvz7T4g4YlVrmCmg7UAwboeyNNg0OzNzKsIZXpr3Sb/ZREDXWgt48RO4UQRDBxJN3B9Rbg== + +"@esbuild/linux-x64@0.17.15": + version "0.17.15" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.17.15.tgz#31b93f9c94c195e852c20cd3d1914a68aa619124" + integrity sha512-JsdS0EgEViwuKsw5tiJQo9UdQdUJYuB+Mf6HxtJSPN35vez1hlrNb1KajvKWF5Sa35j17+rW1ECEO9iNrIXbNg== + +"@esbuild/netbsd-x64@0.17.15": + version "0.17.15" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.17.15.tgz#8da299b3ac6875836ca8cdc1925826498069ac65" + integrity sha512-R6fKjtUysYGym6uXf6qyNephVUQAGtf3n2RCsOST/neIwPqRWcnc3ogcielOd6pT+J0RDR1RGcy0ZY7d3uHVLA== + +"@esbuild/openbsd-x64@0.17.15": + version "0.17.15" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.17.15.tgz#04a1ec3d4e919714dba68dcf09eeb1228ad0d20c" + integrity sha512-mVD4PGc26b8PI60QaPUltYKeSX0wxuy0AltC+WCTFwvKCq2+OgLP4+fFd+hZXzO2xW1HPKcytZBdjqL6FQFa7w== + +"@esbuild/sunos-x64@0.17.15": + version "0.17.15" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.17.15.tgz#6694ebe4e16e5cd7dab6505ff7c28f9c1c695ce5" + integrity sha512-U6tYPovOkw3459t2CBwGcFYfFRjivcJJc1WC8Q3funIwX8x4fP+R6xL/QuTPNGOblbq/EUDxj9GU+dWKX0oWlQ== + +"@esbuild/win32-arm64@0.17.15": + version "0.17.15" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.17.15.tgz#1f95b2564193c8d1fee8f8129a0609728171d500" + integrity sha512-W+Z5F++wgKAleDABemiyXVnzXgvRFs+GVKThSI+mGgleLWluv0D7Diz4oQpgdpNzh4i2nNDzQtWbjJiqutRp6Q== + +"@esbuild/win32-ia32@0.17.15": + version "0.17.15" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.17.15.tgz#c362b88b3df21916ed7bcf75c6d09c6bf3ae354a" + integrity sha512-Muz/+uGgheShKGqSVS1KsHtCyEzcdOn/W/Xbh6H91Etm+wiIfwZaBn1W58MeGtfI8WA961YMHFYTthBdQs4t+w== + +"@esbuild/win32-x64@0.17.15": + version "0.17.15" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.17.15.tgz#c2e737f3a201ebff8e2ac2b8e9f246b397ad19b8" + integrity sha512-DjDa9ywLUUmjhV2Y9wUTIF+1XsmuFGvZoCmOWkli1XcNAh5t25cc7fgsCx4Zi/Uurep3TTLyDiKATgGEg61pkA== + "@eslint-community/eslint-utils@^4.2.0": version "4.2.0" resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.2.0.tgz#a831e6e468b4b2b5ae42bf658bea015bf10bc518" @@ -2327,7 +2535,7 @@ "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" -"@jridgewell/sourcemap-codec@1.4.14", "@jridgewell/sourcemap-codec@^1.4.10": +"@jridgewell/sourcemap-codec@1.4.14", "@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.13": version "1.4.14" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== @@ -2850,6 +3058,11 @@ schema-utils "^3.0.0" source-map "^0.7.3" +"@polka/url@^1.0.0-next.20": + version "1.0.0-next.21" + resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.21.tgz#5de5a2385a35309427f6011992b544514d559aa1" + integrity sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g== + "@popperjs/core@^2.11.5", "@popperjs/core@^2.9.2": version "2.11.6" resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.6.tgz#cee20bd55e68a1720bdab363ecf0c821ded4cd45" @@ -4297,6 +4510,18 @@ "@types/node" "*" "@types/responselike" "^1.0.0" +"@types/chai-subset@^1.3.3": + version "1.3.3" + resolved "https://registry.yarnpkg.com/@types/chai-subset/-/chai-subset-1.3.3.tgz#97893814e92abd2c534de422cb377e0e0bdaac94" + integrity sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw== + dependencies: + "@types/chai" "*" + +"@types/chai@*", "@types/chai@^4.3.4": + version "4.3.4" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.4.tgz#e913e8175db8307d78b4e8fa690408ba6b65dee4" + integrity sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw== + "@types/connect-history-api-fallback@^1.3.5": version "1.3.5" resolved "https://registry.yarnpkg.com/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.3.5.tgz#d1f7a8a09d0ed5a57aee5ae9c18ab9b803205dae" @@ -4721,6 +4946,63 @@ "@typescript-eslint/types" "5.54.0" eslint-visitor-keys "^3.3.0" +"@vitejs/plugin-react@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@vitejs/plugin-react/-/plugin-react-3.1.0.tgz#d1091f535eab8b83d6e74034d01e27d73c773240" + integrity sha512-AfgcRL8ZBhAlc3BFdigClmTUMISmmzHn7sB2h9U1odvc5U/MjWXsAaz18b/WoppUTDBzxOJwo2VdClfUcItu9g== + dependencies: + "@babel/core" "^7.20.12" + "@babel/plugin-transform-react-jsx-self" "^7.18.6" + "@babel/plugin-transform-react-jsx-source" "^7.19.6" + magic-string "^0.27.0" + react-refresh "^0.14.0" + +"@vitest/expect@0.29.8": + version "0.29.8" + resolved "https://registry.yarnpkg.com/@vitest/expect/-/expect-0.29.8.tgz#6ecdd031b4ea8414717d10b65ccd800908384612" + integrity sha512-xlcVXn5I5oTq6NiZSY3ykyWixBxr5mG8HYtjvpgg6KaqHm0mvhX18xuwl5YGxIRNt/A5jidd7CWcNHrSvgaQqQ== + dependencies: + "@vitest/spy" "0.29.8" + "@vitest/utils" "0.29.8" + chai "^4.3.7" + +"@vitest/runner@0.29.8": + version "0.29.8" + resolved "https://registry.yarnpkg.com/@vitest/runner/-/runner-0.29.8.tgz#ede8a7be8a074ea1180bc1d1595bd879ed15971c" + integrity sha512-FzdhnRDwEr/A3Oo1jtIk/B952BBvP32n1ObMEb23oEJNO+qO5cBet6M2XWIDQmA7BDKGKvmhUf2naXyp/2JEwQ== + dependencies: + "@vitest/utils" "0.29.8" + p-limit "^4.0.0" + pathe "^1.1.0" + +"@vitest/spy@0.29.8": + version "0.29.8" + resolved "https://registry.yarnpkg.com/@vitest/spy/-/spy-0.29.8.tgz#2e0c3b30e04d317b2197e3356234448aa432e131" + integrity sha512-VdjBe9w34vOMl5I5mYEzNX8inTxrZ+tYUVk9jxaZJmHFwmDFC/GV3KBFTA/JKswr3XHvZL+FE/yq5EVhb6pSAw== + dependencies: + tinyspy "^1.0.2" + +"@vitest/ui@^0.29.8": + version "0.29.8" + resolved "https://registry.yarnpkg.com/@vitest/ui/-/ui-0.29.8.tgz#0897b8632760047729a07083bc463072545e8b0f" + integrity sha512-+vbLd+c1R/XUWfzJsWeyjeiw13fwJ95I5tguxaqXRg61y9iYUKesVljg7Pttp2uo7VK+kAjvY91J41NZ1Vx3vg== + dependencies: + fast-glob "^3.2.12" + flatted "^3.2.7" + pathe "^1.1.0" + picocolors "^1.0.0" + sirv "^2.0.2" + +"@vitest/utils@0.29.8": + version "0.29.8" + resolved "https://registry.yarnpkg.com/@vitest/utils/-/utils-0.29.8.tgz#423da85fd0c6633f3ab496cf7d2fc0119b850df8" + integrity sha512-qGzuf3vrTbnoY+RjjVVIBYfuWMjn3UMUqyQtdGNZ6ZIIyte7B37exj6LaVkrZiUTvzSadVvO/tJm8AEgbGCBPg== + dependencies: + cli-truncate "^3.1.0" + diff "^5.1.0" + loupe "^2.3.6" + pretty-format "^27.5.1" + "@wallet-standard/base@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@wallet-standard/base/-/base-1.0.1.tgz#860dd94d47c9e3c5c43b79d91c6afdbd7a36264e" @@ -5530,7 +5812,7 @@ acorn-walk@^7.0.0, acorn-walk@^7.1.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== -acorn-walk@^8.0.2, acorn-walk@^8.1.1: +acorn-walk@^8.0.2, acorn-walk@^8.1.1, acorn-walk@^8.2.0: version "8.2.0" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== @@ -5540,7 +5822,7 @@ acorn@^7.0.0, acorn@^7.1.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.1.0, acorn@^8.2.4, acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.8.0, acorn@^8.8.1: +acorn@^8.1.0, acorn@^8.2.4, acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.8.0, acorn@^8.8.1, acorn@^8.8.2: version "8.8.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== @@ -5684,6 +5966,11 @@ ansi-styles@^5.0.0: resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== +ansi-styles@^6.0.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" + integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== + any-promise@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" @@ -6788,6 +7075,11 @@ bytes@3.1.2: resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== +cac@^6.7.14: + version "6.7.14" + resolved "https://registry.yarnpkg.com/cac/-/cac-6.7.14.tgz#804e1e6f506ee363cb0e3ccbb09cad5dd9870959" + integrity sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ== + cache-control-esm@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/cache-control-esm/-/cache-control-esm-1.0.0.tgz#417647ecf1837a5e74155f55d5a4ae32a84e2581" @@ -7145,6 +7437,14 @@ clean-css@^5.2.2: dependencies: source-map "~0.6.0" +cli-truncate@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-3.1.0.tgz#3f23ab12535e3d73e839bb43e73c9de487db1389" + integrity sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA== + dependencies: + slice-ansi "^5.0.0" + string-width "^5.0.0" + client-only@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/client-only/-/client-only-0.0.1.tgz#38bba5d403c41ab150bff64a95c85013cf73bca1" @@ -7886,6 +8186,13 @@ cssstyle@^2.3.0: dependencies: cssom "~0.3.6" +cssstyle@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-3.0.0.tgz#17ca9c87d26eac764bb8cfd00583cff21ce0277a" + integrity sha512-N4u2ABATi3Qplzf0hWbVCdjenim8F3ojEXpBDF5hBpjzW182MjNGLqfmQ0SkSPeQ+V86ZXgeH8aXj6kayd4jgg== + dependencies: + rrweb-cssom "^0.6.0" + csstype@^3.0.2: version "3.1.1" resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.1.tgz#841b532c45c758ee546a11d5bd7b7b473c8c30b9" @@ -7934,6 +8241,15 @@ data-urls@^3.0.2: whatwg-mimetype "^3.0.0" whatwg-url "^11.0.0" +data-urls@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-4.0.0.tgz#333a454eca6f9a5b7b0f1013ff89074c3f522dd4" + integrity sha512-/mMTei/JXPqvFqQtfyTowxmJVwr2PVAeCcDxyFf6LhoOu/09TX2OX3kb2wzi4DMXcfj4OItwDOnhl5oziPnT6g== + dependencies: + abab "^2.0.6" + whatwg-mimetype "^3.0.0" + whatwg-url "^12.0.0" + date-fns@^2.24.0: version "2.29.3" resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.29.3.tgz#27402d2fc67eb442b511b70bbdf98e6411cd68a8" @@ -7977,7 +8293,7 @@ decamelize@^4.0.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== -decimal.js@^10.2.1, decimal.js@^10.4.2: +decimal.js@^10.2.1, decimal.js@^10.4.2, decimal.js@^10.4.3: version "10.4.3" resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23" integrity sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA== @@ -8213,6 +8529,11 @@ diff@^4.0.1: resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== +diff@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.1.0.tgz#bc52d298c5ea8df9194800224445ed43ffc87e40" + integrity sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw== + diffie-hellman@^5.0.0: version "5.0.3" resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" @@ -8448,6 +8769,11 @@ duplexify@^4.1.2: readable-stream "^3.1.1" stream-shift "^1.0.0" +eastasianwidth@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" + integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== + ecc-jsbn@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" @@ -8754,6 +9080,34 @@ es6-symbol@^3.1.1, es6-symbol@^3.1.3: d "^1.0.1" ext "^1.1.2" +esbuild@^0.17.5: + version "0.17.15" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.17.15.tgz#209ebc87cb671ffb79574db93494b10ffaf43cbc" + integrity sha512-LBUV2VsUIc/iD9ME75qhT4aJj0r75abCVS0jakhFzOtR7TQsqQA5w0tZ+KTKnwl3kXE0MhskNdHDh/I5aCR1Zw== + optionalDependencies: + "@esbuild/android-arm" "0.17.15" + "@esbuild/android-arm64" "0.17.15" + "@esbuild/android-x64" "0.17.15" + "@esbuild/darwin-arm64" "0.17.15" + "@esbuild/darwin-x64" "0.17.15" + "@esbuild/freebsd-arm64" "0.17.15" + "@esbuild/freebsd-x64" "0.17.15" + "@esbuild/linux-arm" "0.17.15" + "@esbuild/linux-arm64" "0.17.15" + "@esbuild/linux-ia32" "0.17.15" + "@esbuild/linux-loong64" "0.17.15" + "@esbuild/linux-mips64el" "0.17.15" + "@esbuild/linux-ppc64" "0.17.15" + "@esbuild/linux-riscv64" "0.17.15" + "@esbuild/linux-s390x" "0.17.15" + "@esbuild/linux-x64" "0.17.15" + "@esbuild/netbsd-x64" "0.17.15" + "@esbuild/openbsd-x64" "0.17.15" + "@esbuild/sunos-x64" "0.17.15" + "@esbuild/win32-arm64" "0.17.15" + "@esbuild/win32-ia32" "0.17.15" + "@esbuild/win32-x64" "0.17.15" + escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -9926,7 +10280,7 @@ flat@^5.0.2: resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== -flatted@^3.1.0: +flatted@^3.1.0, flatted@^3.2.7: version "3.2.7" resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787" integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== @@ -11117,6 +11471,11 @@ is-fullwidth-code-point@^3.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== +is-fullwidth-code-point@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz#fae3167c729e7463f8461ce512b080a49268aa88" + integrity sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ== + is-function@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.2.tgz#4f097f30abf6efadac9833b17ca5dc03f8144e08" @@ -12472,6 +12831,38 @@ jsdom@^20.0.0: ws "^8.11.0" xml-name-validator "^4.0.0" +jsdom@^21.1.1: + version "21.1.1" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-21.1.1.tgz#ab796361e3f6c01bcfaeda1fea3c06197ac9d8ae" + integrity sha512-Jjgdmw48RKcdAIQyUD1UdBh2ecH7VqwaXPN3ehoZN6MqgVbMn+lRm1aAT1AsdJRAJpwfa4IpwgzySn61h2qu3w== + dependencies: + abab "^2.0.6" + acorn "^8.8.2" + acorn-globals "^7.0.0" + cssstyle "^3.0.0" + data-urls "^4.0.0" + decimal.js "^10.4.3" + domexception "^4.0.0" + escodegen "^2.0.0" + form-data "^4.0.0" + html-encoding-sniffer "^3.0.0" + http-proxy-agent "^5.0.0" + https-proxy-agent "^5.0.1" + is-potential-custom-element-name "^1.0.1" + nwsapi "^2.2.2" + parse5 "^7.1.2" + rrweb-cssom "^0.6.0" + saxes "^6.0.0" + symbol-tree "^3.2.4" + tough-cookie "^4.1.2" + w3c-xmlserializer "^4.0.0" + webidl-conversions "^7.0.0" + whatwg-encoding "^2.0.0" + whatwg-mimetype "^3.0.0" + whatwg-url "^12.0.1" + ws "^8.13.0" + xml-name-validator "^4.0.0" + jsesc@^2.5.1: version "2.5.2" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" @@ -12600,6 +12991,11 @@ json5@^2.1.2, json5@^2.2.0, json5@^2.2.2: resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== +jsonc-parser@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" + integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== + jsonfile@^2.1.0: version "2.4.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" @@ -12911,6 +13307,11 @@ loader-utils@^3.2.0: resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-3.2.1.tgz#4fb104b599daafd82ef3e1a41fb9265f87e1f576" integrity sha512-ZvFw1KWS3GVyYBYb7qkmRM/WwL2TQQBxgCK62rlvm4WpVQ23Nb4tYjApUlfjrEGvOs7KHEsmyUn75OHZrJMWPw== +local-pkg@^0.4.2: + version "0.4.3" + resolved "https://registry.yarnpkg.com/local-pkg/-/local-pkg-0.4.3.tgz#0ff361ab3ae7f1c19113d9bb97b98b905dbc4963" + integrity sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g== + localforage@^1.7.4: version "1.10.0" resolved "https://registry.yarnpkg.com/localforage/-/localforage-1.10.0.tgz#5c465dc5f62b2807c3a84c0c6a1b1b3212781dd4" @@ -13015,7 +13416,7 @@ loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: dependencies: js-tokens "^3.0.0 || ^4.0.0" -loupe@^2.3.1: +loupe@^2.3.1, loupe@^2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/loupe/-/loupe-2.3.6.tgz#76e4af498103c532d1ecc9be102036a21f787b53" integrity sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA== @@ -13108,6 +13509,13 @@ magic-string@^0.25.0, magic-string@^0.25.7: dependencies: sourcemap-codec "^1.4.8" +magic-string@^0.27.0: + version "0.27.0" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.27.0.tgz#e4a3413b4bab6d98d2becffd48b4a257effdbbf3" + integrity sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA== + dependencies: + "@jridgewell/sourcemap-codec" "^1.4.13" + make-dir@^3.0.0, make-dir@^3.0.2, make-dir@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" @@ -13385,6 +13793,16 @@ mkdirp@^1.0.4: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== +mlly@^1.1.0, mlly@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mlly/-/mlly-1.2.0.tgz#f0f6c2fc8d2d12ea6907cd869066689b5031b613" + integrity sha512-+c7A3CV0KGdKcylsI6khWyts/CYrGTrRVo4R/I7u/cUsy0Conxa6LUhiEzVKIw14lc2L5aiO4+SeVe4TeGRKww== + dependencies: + acorn "^8.8.2" + pathe "^1.1.0" + pkg-types "^1.0.2" + ufo "^1.1.1" + mocha@^10.2.0: version "10.2.0" resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.2.0.tgz#1fd4a7c32ba5ac372e03a17eef435bd00e5c68b8" @@ -13461,6 +13879,11 @@ motion@10.15.5: "@motionone/utils" "^10.15.1" "@motionone/vue" "^10.15.5" +mrmime@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mrmime/-/mrmime-1.0.1.tgz#5f90c825fad4bdd41dc914eff5d1a8cfdaf24f27" + integrity sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw== + ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" @@ -14015,6 +14438,13 @@ p-limit@^3.0.2, p-limit@^3.1.0: dependencies: yocto-queue "^0.1.0" +p-limit@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-4.0.0.tgz#914af6544ed32bfa54670b061cafcbd04984b644" + integrity sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ== + dependencies: + yocto-queue "^1.0.0" + p-locate@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" @@ -14152,7 +14582,7 @@ parse5@6.0.1: resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== -parse5@^7.0.0, parse5@^7.1.1: +parse5@^7.0.0, parse5@^7.1.1, parse5@^7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.1.2.tgz#0736bebbfd77793823240a23b7fc5e010b7f8e32" integrity sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw== @@ -14255,6 +14685,11 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== +pathe@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pathe/-/pathe-1.1.0.tgz#e2e13f6c62b31a3289af4ba19886c230f295ec03" + integrity sha512-ODbEPR0KKHqECXW1GoxdDb+AZvULmXjVPy4rt+pGo2+TnjJTIPJQSVS6N63n8T2Ip+syHhbn52OewKicV0373w== + pathval@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" @@ -14387,6 +14822,15 @@ pkg-dir@^4.1.0, pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" +pkg-types@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pkg-types/-/pkg-types-1.0.2.tgz#c233efc5210a781e160e0cafd60c0d0510a4b12e" + integrity sha512-hM58GKXOcj8WTqUXnsQyJYXdeAPbythQgEF3nTcEo+nkD49chjQ9IKm/QJy9xf6JakXptz86h7ecP2024rrLaQ== + dependencies: + jsonc-parser "^3.2.0" + mlly "^1.1.1" + pathe "^1.1.0" + pkg-up@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-3.1.0.tgz#100ec235cc150e4fd42519412596a28512a0def5" @@ -14960,7 +15404,7 @@ postcss@8.4.14: picocolors "^1.0.0" source-map-js "^1.0.2" -postcss@8.4.21, postcss@^8.0.9, postcss@^8.3.5, postcss@^8.4.19, postcss@^8.4.4: +postcss@8.4.21, postcss@^8.0.9, postcss@^8.3.5, postcss@^8.4.19, postcss@^8.4.21, postcss@^8.4.4: version "8.4.21" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.21.tgz#c639b719a57efc3187b13a1d765675485f4134f4" integrity sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg== @@ -15197,7 +15641,7 @@ punycode@^1.3.2: resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" integrity sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ== -punycode@^2.1.0, punycode@^2.1.1: +punycode@^2.1.0, punycode@^2.1.1, punycode@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== @@ -15548,6 +15992,11 @@ react-refresh@^0.11.0: resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.11.0.tgz#77198b944733f0f1f1a90e791de4541f9f074046" integrity sha512-F27qZr8uUqwhWZboondsPx8tnC3Ct3SxZA3V5WyEvujRyyNv0VYPhoBg1gZ8/MV5tubQp76Trw8lTv9hzRBa+A== +react-refresh@^0.14.0: + version "0.14.0" + resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.14.0.tgz#4e02825378a5f227079554d4284889354e5f553e" + integrity sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ== + react-scripts@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/react-scripts/-/react-scripts-5.0.1.tgz#6285dbd65a8ba6e49ca8d651ce30645a6d980003" @@ -16033,6 +16482,13 @@ rollup@^2.43.1: optionalDependencies: fsevents "~2.3.2" +rollup@^3.18.0: + version "3.20.2" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.20.2.tgz#f798c600317f216de2e4ad9f4d9ab30a89b690ff" + integrity sha512-3zwkBQl7Ai7MFYQE0y1MeQ15+9jsi7XxfrqwTb/9EK8D9C9+//EBR4M+CuA1KODRaNbFez/lWxA5vhEGZp4MUg== + optionalDependencies: + fsevents "~2.3.2" + rpc-websockets@^7.5.1: version "7.5.1" resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.5.1.tgz#e0a05d525a97e7efc31a0617f093a13a2e10c401" @@ -16046,6 +16502,11 @@ rpc-websockets@^7.5.1: bufferutil "^4.0.1" utf-8-validate "^5.0.2" +rrweb-cssom@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz#ed298055b97cbddcdeb278f904857629dec5e0e1" + integrity sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw== + rtcpeerconnection-shim@^1.2.15: version "1.2.15" resolved "https://registry.yarnpkg.com/rtcpeerconnection-shim/-/rtcpeerconnection-shim-1.2.15.tgz#e7cc189a81b435324c4949aa3dfb51888684b243" @@ -16498,6 +16959,11 @@ side-channel@^1.0.4: get-intrinsic "^1.0.2" object-inspect "^1.9.0" +siginfo@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/siginfo/-/siginfo-2.0.0.tgz#32e76c70b79724e3bb567cb9d543eb858ccfaf30" + integrity sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g== + signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: version "3.0.7" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" @@ -16533,6 +16999,15 @@ simple-swizzle@^0.2.2: dependencies: is-arrayish "^0.3.1" +sirv@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/sirv/-/sirv-2.0.2.tgz#128b9a628d77568139cff85703ad5497c46a4760" + integrity sha512-4Qog6aE29nIjAOKe/wowFTxOdmbEZKb+3tsLljaBRzJwtqto0BChD2zzH0LhgCSXiI+V7X+Y45v14wBZQ1TK3w== + dependencies: + "@polka/url" "^1.0.0-next.20" + mrmime "^1.0.0" + totalist "^3.0.0" + sisteransi@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" @@ -16548,6 +17023,14 @@ slash@^4.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-4.0.0.tgz#2422372176c4c6c5addb5e2ada885af984b396a7" integrity sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew== +slice-ansi@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-5.0.0.tgz#b73063c57aa96f9cd881654b15294d95d285c42a" + integrity sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ== + dependencies: + ansi-styles "^6.0.0" + is-fullwidth-code-point "^4.0.0" + snake-case@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-2.1.0.tgz#41bdb1b73f30ec66a04d4e2cad1b76387d4d6d9f" @@ -16758,6 +17241,11 @@ stack-utils@^2.0.3: dependencies: escape-string-regexp "^2.0.0" +stackback@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/stackback/-/stackback-0.0.2.tgz#1ac8a0d9483848d1695e418b6d031a3c3ce68e3b" + integrity sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw== + stackblur-canvas@^2.0.0: version "2.5.0" resolved "https://registry.yarnpkg.com/stackblur-canvas/-/stackblur-canvas-2.5.0.tgz#aa87bbed1560fdcd3138fff344fc6a1c413ebac4" @@ -16802,6 +17290,11 @@ statuses@2.0.1: resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== +std-env@^3.3.1: + version "3.3.2" + resolved "https://registry.yarnpkg.com/std-env/-/std-env-3.3.2.tgz#af27343b001616015534292178327b202b9ee955" + integrity sha512-uUZI65yrV2Qva5gqE0+A7uVAvO40iPo6jGhs7s8keRfHCmtg+uB2X6EiLGCI9IgL1J17xGhvoOqSz79lzICPTA== + steno@^0.4.1: version "0.4.4" resolved "https://registry.yarnpkg.com/steno/-/steno-0.4.4.tgz#071105bdfc286e6615c0403c27e9d7b5dcb855cb" @@ -16920,6 +17413,15 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" +string-width@^5.0.0: + version "5.1.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" + integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== + dependencies: + eastasianwidth "^0.2.0" + emoji-regex "^9.2.2" + strip-ansi "^7.0.1" + string.prototype.matchall@^4.0.6, string.prototype.matchall@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.8.tgz#3bf85722021816dcd1bf38bb714915887ca79fd3" @@ -17071,6 +17573,13 @@ strip-json-comments@^2.0.0, strip-json-comments@~2.0.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ== +strip-literal@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/strip-literal/-/strip-literal-1.0.1.tgz#0115a332710c849b4e46497891fb8d585e404bd2" + integrity sha512-QZTsipNpa2Ppr6v1AmJHESqJ3Uz247MUS0OjrnnZjFAvEoWqxuyFuXn2xLgMtRnijJShAa1HL0gtJyUs7u7n3Q== + dependencies: + acorn "^8.8.2" + style-loader@^3.3.1: version "3.3.1" resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-3.3.1.tgz#057dfa6b3d4d7c7064462830f9113ed417d38575" @@ -17458,6 +17967,21 @@ tiny-invariant@1.3.1: resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.3.1.tgz#8560808c916ef02ecfd55e66090df23a4b7aa642" integrity sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw== +tinybench@^2.3.1: + version "2.4.0" + resolved "https://registry.yarnpkg.com/tinybench/-/tinybench-2.4.0.tgz#83f60d9e5545353610fe7993bd783120bc20c7a7" + integrity sha512-iyziEiyFxX4kyxSp+MtY1oCH/lvjH3PxFN8PGCDeqcZWAJ/i+9y+nL85w99PxVzrIvew/GSkSbDYtiGVa85Afg== + +tinypool@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/tinypool/-/tinypool-0.4.0.tgz#3cf3ebd066717f9f837e8d7d31af3c127fdb5446" + integrity sha512-2ksntHOKf893wSAH4z/+JbPpi92esw8Gn9N2deXX+B0EO92hexAVI9GIZZPx7P5aYo5KULfeOSt3kMOmSOy6uA== + +tinyspy@^1.0.2: + version "1.1.1" + resolved "https://registry.yarnpkg.com/tinyspy/-/tinyspy-1.1.1.tgz#0cb91d5157892af38cb2d217f5c7e8507a5bf092" + integrity sha512-UVq5AXt/gQlti7oxoIg5oi/9r0WpF7DGEVwXgqWSMmyN16+e3tl5lIvTaOpJ3TAtu5xFzWccFRM4R5NaWHF+4g== + title-case@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/title-case/-/title-case-2.1.1.tgz#3e127216da58d2bc5becf137ab91dae3a7cd8faa" @@ -17498,6 +18022,11 @@ toidentifier@1.0.1: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== +totalist@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/totalist/-/totalist-3.0.1.tgz#ba3a3d600c915b1a97872348f79c127475f6acf8" + integrity sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ== + tough-cookie@^4.0.0, tough-cookie@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.2.tgz#e53e84b85f24e0b65dd526f46628db6c85f6b874" @@ -17537,6 +18066,13 @@ tr46@^3.0.0: dependencies: punycode "^2.1.1" +tr46@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-4.1.1.tgz#281a758dcc82aeb4fe38c7dfe4d11a395aac8469" + integrity sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw== + dependencies: + punycode "^2.3.0" + tr46@~0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" @@ -17739,6 +18275,11 @@ u3@^0.1.1: resolved "https://registry.yarnpkg.com/u3/-/u3-0.1.1.tgz#5f52044f42ee76cd8de33148829e14528494b73b" integrity sha512-+J5D5ir763y+Am/QY6hXNRlwljIeRMZMGs0cT6qqZVVzzT3X3nFPXVyPOFRMOR4kupB0T8JnCdpWdp6Q/iXn3w== +ufo@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.1.1.tgz#e70265e7152f3aba425bd013d150b2cdf4056d7c" + integrity sha512-MvlCc4GHrmZdAllBc0iUDowff36Q9Ndw/UzqmEKyrfSzokTd9ZCy1i+IIk5hrYKkjoYVQyNbrw7/F8XJ2rEwTg== + uint8arrays@3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uint8arrays/-/uint8arrays-3.1.0.tgz#8186b8eafce68f28bd29bd29d683a311778901e2" @@ -18079,6 +18620,60 @@ vite-compatible-readable-stream@^3.6.1: string_decoder "^1.1.1" util-deprecate "^1.0.1" +vite-node@0.29.8: + version "0.29.8" + resolved "https://registry.yarnpkg.com/vite-node/-/vite-node-0.29.8.tgz#6a1c9d4fb31e7b4e0f825d3a37abe3404e52bd8e" + integrity sha512-b6OtCXfk65L6SElVM20q5G546yu10/kNrhg08afEoWlFRJXFq9/6glsvSVY+aI6YeC1tu2TtAqI2jHEQmOmsFw== + dependencies: + cac "^6.7.14" + debug "^4.3.4" + mlly "^1.1.0" + pathe "^1.1.0" + picocolors "^1.0.0" + vite "^3.0.0 || ^4.0.0" + +"vite@^3.0.0 || ^4.0.0": + version "4.2.1" + resolved "https://registry.yarnpkg.com/vite/-/vite-4.2.1.tgz#6c2eb337b0dfd80a9ded5922163b94949d7fc254" + integrity sha512-7MKhqdy0ISo4wnvwtqZkjke6XN4taqQ2TBaTccLIpOKv7Vp2h4Y+NpmWCnGDeSvvn45KxvWgGyb0MkHvY1vgbg== + dependencies: + esbuild "^0.17.5" + postcss "^8.4.21" + resolve "^1.22.1" + rollup "^3.18.0" + optionalDependencies: + fsevents "~2.3.2" + +vitest@^0.29.8: + version "0.29.8" + resolved "https://registry.yarnpkg.com/vitest/-/vitest-0.29.8.tgz#9c13cfa007c3511e86c26e1fe9a686bb4dbaec80" + integrity sha512-JIAVi2GK5cvA6awGpH0HvH/gEG9PZ0a/WoxdiV3PmqK+3CjQMf8c+J/Vhv4mdZ2nRyXFw66sAg6qz7VNkaHfDQ== + dependencies: + "@types/chai" "^4.3.4" + "@types/chai-subset" "^1.3.3" + "@types/node" "*" + "@vitest/expect" "0.29.8" + "@vitest/runner" "0.29.8" + "@vitest/spy" "0.29.8" + "@vitest/utils" "0.29.8" + acorn "^8.8.1" + acorn-walk "^8.2.0" + cac "^6.7.14" + chai "^4.3.7" + debug "^4.3.4" + local-pkg "^0.4.2" + pathe "^1.1.0" + picocolors "^1.0.0" + source-map "^0.6.1" + std-env "^3.3.1" + strip-literal "^1.0.0" + tinybench "^2.3.1" + tinypool "^0.4.0" + tinyspy "^1.0.2" + vite "^3.0.0 || ^4.0.0" + vite-node "0.29.8" + why-is-node-running "^2.2.2" + vm-browserify@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" @@ -18930,6 +19525,14 @@ whatwg-url@^11.0.0: tr46 "^3.0.0" webidl-conversions "^7.0.0" +whatwg-url@^12.0.0, whatwg-url@^12.0.1: + version "12.0.1" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-12.0.1.tgz#fd7bcc71192e7c3a2a97b9a8d6b094853ed8773c" + integrity sha512-Ed/LrqB8EPlGxjS+TrsXcpUond1mhccS3pchLhzSgPCnTimUCKj3IZE75pAs5m6heB2U2TMerKFUXheyHY+VDQ== + dependencies: + tr46 "^4.1.1" + webidl-conversions "^7.0.0" + whatwg-url@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" @@ -19013,6 +19616,14 @@ which@^2.0.1: dependencies: isexe "^2.0.0" +why-is-node-running@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/why-is-node-running/-/why-is-node-running-2.2.2.tgz#4185b2b4699117819e7154594271e7e344c9973e" + integrity sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA== + dependencies: + siginfo "^2.0.0" + stackback "0.0.2" + window-size@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.2.0.tgz#b4315bb4214a3d7058ebeee892e13fa24d98b075" @@ -19296,6 +19907,11 @@ ws@^8.11.0, ws@^8.4.2, ws@^8.5.0: resolved "https://registry.yarnpkg.com/ws/-/ws-8.12.1.tgz#c51e583d79140b5e42e39be48c934131942d4a8f" integrity sha512-1qo+M9Ba+xNhPB+YTWUlK6M17brTut5EXbcBaMRN5pH5dFrXz7lzz1ChFSUq3bOUl8yEvSenhHmYUNJxFzdJew== +ws@^8.13.0: + version "8.13.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" + integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== + ws@~8.11.0: version "8.11.0" resolved "https://registry.yarnpkg.com/ws/-/ws-8.11.0.tgz#6a0d36b8edfd9f96d8b25683db2f8d7de6e8e143" @@ -19558,6 +20174,11 @@ yocto-queue@^0.1.0: resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== +yocto-queue@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.0.0.tgz#7f816433fb2cbc511ec8bf7d263c3b58a1a3c251" + integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g== + zen-observable-ts@^0.8.21: version "0.8.21" resolved "https://registry.yarnpkg.com/zen-observable-ts/-/zen-observable-ts-0.8.21.tgz#85d0031fbbde1eba3cd07d3ba90da241215f421d"