Skip to content

Commit

Permalink
change tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya Smiyukha committed Jul 20, 2023
1 parent ea7da3c commit a5c8fb1
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions packages/ui/src/app/App.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ export const BuyMembershipTxFailure: Story = {
// ----------------------------------------------------------------------------
// Test Emil Subsciption Modal
// ----------------------------------------------------------------------------
export const EmailSubscriptionModal: Story = {
export const EmailSubscriptionModalDecline: Story = {
args: {
isLoggedIn: true,
hasMemberships: true,
Expand All @@ -427,14 +427,30 @@ export const EmailSubscriptionModal: Story = {
isRPCNodeConnected: true,
hasRegisteredEmail: false,
},

name: 'Decline email subscription modal',

play: async ({ canvasElement }) => {
const screen = within(canvasElement)
const element = await screen.getByText('Sign up to email notifications')
expect(element)
await userEvent.click(screen.getByText('Not now'))
expect(element).not.toBeInTheDocument()
},
}

expect(screen.getByText('Sign up to email notifications'))
userEvent.click(screen.getByText('Not now'))
expect(screen.getByText('Sign up to email notifications')).not.toBeInTheDocument()
export const EmailSubscriptionModalSubscribe: Story = {
args: {
isLoggedIn: true,
hasMemberships: true,
hasAccounts: true,
hasFunds: true,
hasWallet: true,
isRPCNodeConnected: true,
hasRegisteredEmail: false,
},
play: async ({ canvasElement }) => {
const screen = within(canvasElement)
const button = screen.getByText(/^Sign and Authorize Email/i)
await userEvent.type(screen.getByPlaceholderText('Add email for notifications here'), 'test@email.com')
await userEvent.click(button)
expect(screen.getByText('Pending transaction'))
},
}

0 comments on commit a5c8fb1

Please sign in to comment.