-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: ✨ adds financial assessment notification * refactor: 🎨 sorts the object block * feat: ✨ displays financial assessment notification on trigger from backend * chore: 🚑 resolves merge conflict with master * test: 🧪 adds test case for app-notification * test: 🧪 adds test cases for notification
- Loading branch information
1 parent
b86a254
commit 44319aa
Showing
8 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
packages/core/src/App/Containers/__tests__/app-notification-messages.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import AppNotificationMessages from '../app-notification-messages'; | ||
|
||
jest.mock('Stores/connect', () => ({ | ||
__esModule: true, | ||
default: 'mockedDefaultExport', | ||
connect: | ||
() => | ||
<T,>(Component: T) => | ||
Component, | ||
})); | ||
|
||
jest.mock('react-router-dom', () => ({ | ||
useLocation: jest.fn(() => ({ | ||
pathname: '/appstore/traders-hub', | ||
})), | ||
})); | ||
|
||
jest.mock('react-transition-group', () => ({ | ||
TransitionGroup: jest.fn(({ children }) => <div>{children}</div>), | ||
CSSTransition: jest.fn(({ children }) => <div>{children}</div>), | ||
})); | ||
|
||
jest.mock('../../Components/Elements/NotificationMessage', () => jest.fn(() => 'mockedNotification')); | ||
|
||
describe('AppNotificationMessages', () => { | ||
it('should render the component', () => { | ||
const mock_props = { | ||
marked_notifications: [], | ||
notification_messages: [ | ||
{ | ||
action: { | ||
route: '/account/financial-assessment', | ||
text: 'Start now', | ||
}, | ||
header: 'Pending action required', | ||
key: 'notify_financial_assessment', | ||
message: 'Please complete your financial assessment.', | ||
should_show_again: true, | ||
type: 'warning', | ||
}, | ||
], | ||
landing_company_shortcode: 'svg', | ||
has_iom_account: false, | ||
has_malta_account: false, | ||
is_logged_in: true, | ||
should_show_popups: true, | ||
}; | ||
render(<AppNotificationMessages {...mock_props} />); | ||
expect(screen.getByText('mockedNotification')).toBeInTheDocument(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44319aa
There was a problem hiding this comment.
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:
deriv-app – ./
deriv-app.vercel.app
binary.sx
deriv-app-git-master.binary.sx
deriv-app.binary.sx