forked from binary-com/deriv-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:binary-com/deriv-app into suisin/…
…DIEL_flow_change
- Loading branch information
Showing
165 changed files
with
4,984 additions
and
4,842 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
33 changes: 33 additions & 0 deletions
33
packages/appstore/src/components/main-title-bar/__tests__/index.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,33 @@ | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import { StoreProvider, mockStore } from '@deriv/stores'; | ||
import MainTitleBar from '..'; | ||
|
||
describe('MainTitleBar', () => { | ||
const render_container = () => { | ||
const mock = mockStore({}); | ||
|
||
const wrapper = ({ children }: { children: JSX.Element }) => ( | ||
<StoreProvider store={mock}>{children}</StoreProvider> | ||
); | ||
|
||
return render(<MainTitleBar />, { | ||
wrapper, | ||
}); | ||
}; | ||
|
||
it('should render the component', () => { | ||
const { container } = render_container(); | ||
expect(container).toBeInTheDocument(); | ||
}); | ||
|
||
it('should render the correct title text', () => { | ||
render_container(); | ||
expect(screen.getByText(/Trader's Hub/)).toBeInTheDocument(); | ||
}); | ||
|
||
it('should render the total assets text', () => { | ||
render_container(); | ||
expect(screen.getByText(/Total assets/)).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
5 changes: 2 additions & 3 deletions
5
...ages/appstore/src/components/modals/regulators-compare-modal/regulators-compare-modal.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
68 changes: 68 additions & 0 deletions
68
packages/appstore/src/components/onboarding-new/__tests__/static-dashboard.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,68 @@ | ||
import React from 'react'; | ||
import { ContentFlag } from '@deriv/shared'; | ||
import { StoreProvider, mockStore } from '@deriv/stores'; | ||
import { render, screen } from '@testing-library/react'; | ||
import StaticDashboard, { TStaticDashboard } from '../static-dashboard'; | ||
|
||
describe('StaticDashboard', () => { | ||
const render_container = (mock_store_override = {}) => { | ||
const mock_store = mockStore(mock_store_override); | ||
const wrapper = ({ children }: { children: JSX.Element }) => ( | ||
<StoreProvider store={mock_store}>{children}</StoreProvider> | ||
); | ||
const mock_props: TStaticDashboard = { | ||
is_blurry: { | ||
icon: false, | ||
item: false, | ||
text: false, | ||
get: false, | ||
topup: false, | ||
trade: false, | ||
cfd_item: false, | ||
cfd_text: false, | ||
options_item: false, | ||
options_text: false, | ||
cfd_description: false, | ||
options_description: false, | ||
platformlauncher: false, | ||
}, | ||
is_onboarding_animated: { | ||
text: false, | ||
trade: false, | ||
topup: false, | ||
button: false, | ||
get: false, | ||
}, | ||
}; | ||
return render(<StaticDashboard {...mock_props} />, { | ||
wrapper, | ||
}); | ||
}; | ||
|
||
it('should display the component', () => { | ||
const { container } = render_container(); | ||
expect(container).toBeInTheDocument(); | ||
}); | ||
|
||
it('should display both CFDs and Multipliers section', () => { | ||
render_container(); | ||
const dashboard_sections = screen.getByTestId('dt_onboarding_dashboard'); | ||
expect(dashboard_sections?.textContent?.match(/Multipliers/)).not.toBeNull(); | ||
expect(dashboard_sections?.textContent?.match(/CFDs/)).not.toBeNull(); | ||
}); | ||
|
||
it('should display Multipliers and CFDs section in order if the user is non eu', () => { | ||
render_container({ | ||
client: { is_logged_in: true }, | ||
traders_hub: { content_flag: ContentFlag.LOW_RISK_CR_NON_EU }, | ||
}); | ||
const dashboard_sections = screen.getByTestId('dt_onboarding_dashboard'); | ||
expect(dashboard_sections).not.toHaveClass('static-dashboard--eu'); | ||
}); | ||
|
||
it('should display Multipliers and CFDs section in reverse order if the user is eu', () => { | ||
render_container({ client: { is_logged_in: true }, traders_hub: { content_flag: ContentFlag.EU_REAL } }); | ||
const dashboard_sections = screen.getByTestId('dt_onboarding_dashboard'); | ||
expect(dashboard_sections).toHaveClass('static-dashboard--eu'); | ||
}); | ||
}); |
Oops, something went wrong.