Skip to content

Commit

Permalink
🤯 Refactor add new proposal tests (#4473)
Browse files Browse the repository at this point in the history
* Reduce fee re-calculation in `AddNewProposalModal`

* Fix the "warningAccepted" logic

* Fix the proposal `WarningModal`

* Test the signal proposal flow

* Add "General parameters" tests

* Add "Funding Request" and "Set Referral Cut" tests

* Fix race condition during form validation

* Fix incomplete tests

* Use one story per proposal type

* Add the "Decrease Working Group Lead Stake" test

* Add "Terminate Working Group Lead" test

* Don't initialize number inputs with a 0

* Add Create Working Group Lead Opening test

* Add the Set Working Group Lead Reward test

* Add the Set Max Validator Count test

* Add the Cancel Working Group Lead Opening test

* Add the Set Council Budget Increment test

* Add the Set Councilor Reward test

* Add the Set Membership Lead Invitation Quota test

* Add the Fill Working Group Lead Opening test

* Add the Set Initial Invitation Count test

* Add the Set Initial Invitation Balance test

* Add the Set Membership Price test

* Add the Update Working Group Budget test

* Add the Runtime Upgrade test

* Complete the AddNewProposalHappy test

* Test not enough funds case

* Add transaction failure tests

* Remove the "UI: AddNewProposalModal" test suite

* Fix tests failing in Playwright

* Simplify expected tx parameters amounts

* Fix failing "unit" tests
  • Loading branch information
thesan authored Jul 18, 2023
1 parent 87bf9c3 commit c2416dc
Show file tree
Hide file tree
Showing 16 changed files with 1,495 additions and 1,822 deletions.
3 changes: 3 additions & 0 deletions packages/ui/.storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Decorator } from '@storybook/react'
import { configure } from '@storybook/testing-library'
import React from 'react'
import { I18nextProvider } from 'react-i18next'
import { useForm, FormProvider } from 'react-hook-form'
Expand All @@ -15,6 +16,8 @@ import { TransactionStatusProvider } from '../src/common/providers/transactionSt
import { MockProvidersDecorator, MockRouterDecorator } from '../src/mocks/providers'
import { i18next } from '../src/services/i18n'

configure({ testIdAttribute: 'id' })

const stylesWrapperDecorator: Decorator = (Story) => (
<>
<GlobalStyle />
Expand Down
Loading

2 comments on commit c2416dc

@vercel
Copy link

@vercel vercel bot commented on c2416dc Jul 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

pioneer-2-storybook – ./

pioneer-2-storybook-git-dev-joystream.vercel.app
pioneer-2-storybook-joystream.vercel.app
pioneer-2-storybook.vercel.app

@vercel
Copy link

@vercel vercel bot commented on c2416dc Jul 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

pioneer-2 – ./

pioneer-2-joystream.vercel.app
pioneer-2.vercel.app
pioneer-2-git-dev-joystream.vercel.app

Please sign in to comment.