-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'binary-com:master' into shaheer/90982/personal-details-…
…spec
- Loading branch information
Showing
74 changed files
with
3,697 additions
and
23,275 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,7 @@ | ||
## Changes: | ||
|
||
Please include a summary of the change and which issue is fixed below: | ||
- ... | ||
Please provide a summary of the change. | ||
|
||
## When you need to add unit test | ||
### Screenshots: | ||
|
||
- [ ] If this change disrupt current flow | ||
- [ ] If this change is adding new flow | ||
|
||
## When you need to add integration test | ||
|
||
- [ ] If components from external libraries are being used to define the flow, e.g. @deriv/components | ||
- [ ] If it relies on a very specific set of props with no default behavior for the current component. | ||
|
||
## Test coverage checklist (for reviewer) | ||
|
||
- [ ] Ensure utility / function has a test case | ||
- [ ] Ensure all the tests are passing | ||
|
||
## Type of change | ||
|
||
- [ ] Bug fix | ||
- [ ] New feature | ||
- [ ] Update feature | ||
- [ ] Refactor code | ||
- [ ] Translation to code | ||
- [ ] Translation to crowdin | ||
- [ ] Script configuration | ||
- [ ] Improve performance | ||
- [ ] Style only | ||
- [ ] Dependency update | ||
- [ ] Documentation update | ||
- [ ] Release | ||
Please provide some screenshots of the change. |
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,18 @@ | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
|
||
name: 'Close stale issues and PRs' | ||
on: | ||
schedule: | ||
- cron: '30 1 * * *' | ||
|
||
jobs: | ||
stale: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/stale@v8 | ||
with: | ||
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days.' | ||
days-before-stale: 60 | ||
days-before-close: 5 |
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
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
140 changes: 140 additions & 0 deletions
140
packages/appstore/src/components/containers/__tests__/currency-switcher-container.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,140 @@ | ||
import React from 'react'; | ||
import CurrentSwitcherContainer from '../currency-switcher-container'; | ||
import { render, screen } from '@testing-library/react'; | ||
import { StoreProvider, mockStore } from '@deriv/stores'; | ||
|
||
describe('CurrentSwitcherContainer', () => { | ||
it('should render the modal', async () => { | ||
const mock = mockStore({ | ||
modules: { | ||
cfd: { | ||
current_list: { | ||
CR123123: { | ||
landing_company_short: 'maltainvest', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}); | ||
|
||
const wrapper = ({ children }: { children: JSX.Element }) => ( | ||
<StoreProvider store={mock}>{children}</StoreProvider> | ||
); | ||
|
||
const { container } = render( | ||
<CurrentSwitcherContainer actions={null} has_interaction={false} icon='USD' title='USD' />, | ||
{ | ||
wrapper, | ||
} | ||
); | ||
expect(container).toBeInTheDocument(); | ||
}); | ||
|
||
it('should not have the dropdown if is demo is true', () => { | ||
const mock = mockStore({ | ||
modules: { | ||
cfd: { | ||
current_list: { | ||
CR123123: { | ||
landing_company_short: 'maltainvest', | ||
}, | ||
}, | ||
}, | ||
}, | ||
traders_hub: { | ||
is_demo: true, | ||
}, | ||
}); | ||
const wrapper = ({ children }: { children: JSX.Element }) => ( | ||
<StoreProvider store={mock}>{children}</StoreProvider> | ||
); | ||
|
||
render(<CurrentSwitcherContainer actions={null} has_interaction={false} icon='USD' title='USD' />, { | ||
wrapper, | ||
}); | ||
|
||
expect(screen.queryByTestId('currency-switcher-container__arrow')).not.toBeInTheDocument(); | ||
}); | ||
|
||
it('should not have the dropdown if is_eu_user is true', () => { | ||
const mock = mockStore({ | ||
modules: { | ||
cfd: { | ||
current_list: { | ||
CR123123: { | ||
landing_company_short: 'maltainvest', | ||
}, | ||
}, | ||
}, | ||
}, | ||
traders_hub: { | ||
is_eu_user: true, | ||
}, | ||
}); | ||
const wrapper = ({ children }: { children: JSX.Element }) => ( | ||
<StoreProvider store={mock}>{children}</StoreProvider> | ||
); | ||
|
||
render(<CurrentSwitcherContainer actions={null} has_interaction={false} icon='USD' title='USD' />, { | ||
wrapper, | ||
}); | ||
|
||
expect(screen.queryByTestId('currency-switcher-container__arrow')).not.toBeInTheDocument(); | ||
}); | ||
|
||
it('should have pending in the classname if the document status is pending', () => { | ||
const mock = mockStore({ | ||
modules: { | ||
cfd: { | ||
current_list: { | ||
CR123123: { | ||
landing_company_short: 'maltainvest', | ||
}, | ||
}, | ||
}, | ||
}, | ||
client: { | ||
authentication_status: { | ||
document_status: 'pending', | ||
}, | ||
}, | ||
}); | ||
const wrapper = ({ children }: { children: JSX.Element }) => ( | ||
<StoreProvider store={mock}>{children}</StoreProvider> | ||
); | ||
|
||
render(<CurrentSwitcherContainer actions={null} has_interaction={false} icon='USD' title='USD' />, { | ||
wrapper, | ||
}); | ||
|
||
expect(screen.getByText('USD')).toHaveClass('currency-switcher-container__content--text--pending'); | ||
}); | ||
|
||
it('should have default in the classname if the document status is default', () => { | ||
const mock = mockStore({ | ||
modules: { | ||
cfd: { | ||
current_list: { | ||
CR123123: { | ||
landing_company_short: 'maltainvest', | ||
}, | ||
}, | ||
}, | ||
}, | ||
client: { | ||
authentication_status: { | ||
document_status: 'default', | ||
}, | ||
}, | ||
}); | ||
const wrapper = ({ children }: { children: JSX.Element }) => ( | ||
<StoreProvider store={mock}>{children}</StoreProvider> | ||
); | ||
|
||
render(<CurrentSwitcherContainer actions={null} has_interaction={false} icon='USD' title='USD' />, { | ||
wrapper, | ||
}); | ||
|
||
expect(screen.getByText('USD')).toHaveClass('currency-switcher-container__content--text--default'); | ||
}); | ||
}); |
Oops, something went wrong.