-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maryia/Kate/DTRA-19/task-add-turbos #7514
Merged
sandeep-deriv
merged 162 commits into
deriv-com:master
from
maryia-deriv:maryia/87354/task-add-turbos
Aug 9, 2023
Merged
Changes from 158 commits
Commits
Show all changes
162 commits
Select commit
Hold shift + click to select a range
ef24949
feat: connect turbos contracts_for & take barrier_choices
maryia-deriv 5e5dbfe
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv fe7a0e4
chore: add barrier count to turbos config
maryia-deriv bf3d299
chore: connected proposal API + added Stake header + updated purchase…
maryia-deriv 332dbd2
Kate/87485/add Turbos to the Trade types list (#74)
kate-deriv 28104c1
Kate/87510/add existing Take Profit component to Turbos Trade params …
kate-deriv 55995ce
fix: maryia/hide info from purchase button correctly
maryia-deriv 4d5402c
hamza/ feat: Barrier Line Colors depend upon the contract type (#80)
hamza-deriv 247177a
hamza/dynamic Turbos purchase button with icons (#79)
hamza-deriv 8e7b984
Kate/87536/add existing Duration & Amount(Stake) components to Turbos…
kate-deriv e8fa9b5
Merge branch master of github.com:binary-com/deriv-app into maryia/87…
maryia-deriv 935c243
hamza/88083/To Adjust the purchase button styles including animation …
hamza-deriv e51a57b
Kate/87506/To implement Turbos Contract card in Recent Positions draw…
kate-deriv aa0aeba
Hamza / 87508/feat:To add Turbos to Open Positions page [Desktop & Re…
hamza-deriv 481fde6
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv b04fffe
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv b3e3327
Kate/87395/add turbos barriers component (#87)
kate-deriv 5f5fb50
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv 4a0adc4
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv 640432e
Kate/87397/[Responsive]: To add Collapsed Turbos barriers in Trade pa…
kate-deriv 0e69942
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv e8bdbd4
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv 64927e5
Hamza/ 88943 /feat: add Long & Short Tabs to trade params for desktop…
hamza-deriv fcd4d01
Merge branch master of github.com:binary-com/deriv-app into maryia/87…
maryia-deriv 3d17195
Kate/87400/add Expanded view for Turbos Barriers opening in a MobileD…
kate-deriv 1e7e3a9
Merge branch 'master' of github.com:binary-com/deriv-app into maryia/…
maryia-deriv 7866859
Hamza/89706/test cases of new features (#96)
hamza-deriv bd39f9d
Hamza/87396/feat: responsive trade type tabs (#98)
hamza-deriv ab0b1b6
Merge branch 'master' of github.com:binary-com/deriv-app; branch 'mar…
maryia-deriv 741e075
Kate/89669/tests for turbos (#97)
kate-deriv 189a052
fix: change style for turbos contract card (#100)
kate-deriv fd2b3ff
refactor: maryia/refactored TurbosInfo, tests & OpenPositions
maryia-deriv c024b95
Merge branch 'master' of github.com:binary-com/deriv-app into maryia/…
maryia-deriv f0aaafc
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv 59d98fb
Kate/90808/90829/ To migrate turbos-card-body, turbos-trade-descripti…
kate-deriv 3914479
Kate/90812/To migrate turbos-info and payout-per-point to TS together…
kate-deriv a2f5e63
refactor: update function for turbos cards filtration (#105)
kate-deriv 1144f16
Merge branch master of github.com:binary-com/deriv-app into maryia/87…
maryia-deriv 0aad8c9
chore: vanilla+turbos adjustment
maryia-deriv 4f72010
chore: integrate turbos into options in open positions
maryia-deriv e1e7a70
chore: maryia/design adjustments
maryia-deriv 4db8c56
Kate/87523/Make barriers and payout per point collapsible in responsi…
kate-deriv 1010ac0
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv 9c73f66
Kate/91508/To finalize Payout per point component and its tooltip (#110)
kate-deriv 6fe8c97
refactor: replace base tags with text tag and add duration text funct…
kate-deriv 01e3b56
Kate/91602/Display Long and Short open contracts in DTrader chart sim…
kate-deriv 8abeaa7
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv c71ccc9
refactor: maryia/rounding payout per point + refactoring
maryia-deriv 5415ea0
Kate/91815/Final checks and adjustments (#113)
kate-deriv 8897afd
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv 58f6257
refactor: reused MinMaxStakeInfo & PayoutPerPointMobile for vanillas …
maryia-deriv 4cc7a67
Merge branch 'master' of github.com:binary-com/deriv-app into maryia/…
maryia-deriv c1a9679
Merge branch master of github.com:binary-com/deriv-app into maryia/87…
maryia-deriv 4645550
Kate/91999/Technical debt: To reuse Vanillas & Turbos common UI eleme…
kate-deriv 8b457af
refactor: barriers-list and its body & trade-type-tabs
maryia-deriv 62c8172
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv fc98fbf
refactor: address review comments
maryia-deriv ade4b42
refactor: address review comments
maryia-deriv 03ae381
Merge branch 'master' of github.com:binary-com/deriv-app into maryia/…
maryia-deriv 97c3450
refactor: remove getTurbosDurationText
maryia-deriv 67faa25
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv a882aeb
refactor: old getDurationUnitText to reduce cognitive complexity
maryia-deriv c1bcedb
fix: address review comments
maryia-deriv 96ff6b9
Merge branch master of github.com:binary-com/deriv-app into maryia/87…
maryia-deriv 22a8b7e
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv 8a44b0d
fix: conditional rendering of total profit/loss
maryia-deriv 25c1029
fix: replace time and add comment (#116)
kate-deriv 06e4dad
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv b7f1172
Kate/refactor after last review (#117)
kate-deriv d7788f3
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv f5fa193
fix: filter turbos cards in responsive & reports popover text
maryia-deriv 8991c53
refactor: address review comments
maryia-deriv 4f576ab
refactor: TurbosTradeDescription content
maryia-deriv eaf66e2
Merge branch master of github.com:binary-com/deriv-app into maryia/87…
maryia-deriv 1b35a4b
Merge branch master of github.com:binary-com/deriv-app into maryia/87…
maryia-deriv 5fdccc3
chore: caching barrier choices and selected barrier for turbos
maryia-deriv 24cba3f
fix: add response check (#118)
kate-deriv 3585e69
Kate/92888/turbos content update (#119)
kate-deriv 4dada65
Kate/93137/Profit value is not displayed right in the contract detail…
kate-deriv fa38af5
Merge branch master of github.com:binary-com/deriv-app into maryia/87…
maryia-deriv 6bcb6ff
fix: bug with barriers in contract details (#121)
kate-deriv 30388b0
fix: maryia/93143/chart markers count in contract details + refactoring
maryia-deriv 5e52d6b
revert: unnecessary change to chart markers count for turbos
maryia-deriv 762a4d5
Kate/93403/Payout per point is not displayed in contract detail page …
kate-deriv bcd3036
refactor: minor refactoring
maryia-deriv 1b4ca87
Merge branch 'master' of github.com:binary-com/deriv-app into maryia/…
maryia-deriv f04b3b7
revert: no longer needed changes in useStore.tsx
maryia-deriv 1c780cd
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv 2e15a2d
Kate/93332/CD: [Change Request] replace contract card fields by new o…
kate-deriv 5d3a87a
Merge branch 'master' of github.com:binary-com/deriv-app into maryia/…
maryia-deriv 9c6522d
fix: change style for turbos mobile (#124)
kate-deriv c0dd6cb
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv d197cb7
Kate/Barrier text in the section is not aligned properly (#125)
kate-deriv d54641a
Merge branch master of github.com:binary-com/deriv-app into maryia/87…
maryia-deriv d690e90
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv b4a910f
build: fix types
maryia-deriv eb0d476
fix: imports for new tsx files
maryia-deriv a82462b
refactor: replace old turbo icons (#126)
kate-deriv d74da0e
fix: types + localization + reverted Vanillas tooltip text changes
maryia-deriv f39db28
Merge branch master of github.com:binary-com/deriv-app into maryia/87…
maryia-deriv b00f3d1
fix: add icon for turbos long
kate-deriv 6fa46b0
chore: update icon bundle
kate-deriv ae31dad
Merge pull request #127 from kate-deriv/kate/turbos_chore_icons
matin-deriv 9a4adc4
refactor: use number of contracts instead of shortcode
kate-deriv e8b7873
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv f1c4e00
refactor: sonarcloud + tests
maryia-deriv 796b09e
Merge branch master of github.com:binary-com/deriv-app into maryia/87…
maryia-deriv e7c4129
fix: conflicts + address review
maryia-deriv 7e20483
refactor: as per reviews
maryia-deriv 2d0ba8a
fix: apply gradient style to all contracts (#132)
kate-deriv 39438ec
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv 0445f49
Merge branch master of github.com:binary-com/deriv-app into maryia/87…
maryia-deriv 1e7d231
Merge branch 'master' of github.com:binary-com/deriv-app into maryia/…
maryia-deriv fa8fdce
chore: improve types as per reviews
maryia-deriv bae11f7
chore: address reviews
maryia-deriv 41da8fb
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv acf1b21
refactor: sonarcloud warnings
maryia-deriv 9ba9b25
build: trigger build
maryia-deriv d319a55
refactor: rename number of contracts (#134)
kate-deriv f3bde6f
Kate / Apply suggestions from last code review (#135)
kate-deriv 6e1609f
Merge branch master of github.com:binary-com/deriv-app into maryia/87…
maryia-deriv 1752909
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv 21236f2
fix: address review comments
maryia-deriv 387c1ec
test: fix tests
maryia-deriv 0118657
fix: types
maryia-deriv 3e3ccd5
Merge branch 'master' of github.com:binary-com/deriv-app into maryia/…
maryia-deriv 7530f74
Merge branch master of github.com:binary-com/deriv-app into maryia/87…
maryia-deriv 37b4fba
fix: sonarcloud warnings
maryia-deriv e06f977
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv b5056f6
Merge branch 'master' of github.com:binary-com/deriv-app into maryia/…
maryia-deriv 64e432d
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv ecb339f
Merge branch master of github.com:binary-com/deriv-app into maryia/87…
maryia-deriv eb8b412
build: trigger checks
maryia-deriv 0d584af
fix: remove barrier shade
maryia-deriv 7296e51
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv 560db11
fix: contract card values alignment
maryia-deriv 63a2feb
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv 3791bb1
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv 523716a
fix: missing colon after Barrier
maryia-deriv aa5e11f
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv 496a199
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv 1d25508
chore: add vanilla header with timer to turbos contract card in mobil…
maryia-deriv 6e1c536
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv 29bade5
fix: sonarcloud warning
maryia-deriv 723b8d4
chore: show full title only in open positions
maryia-deriv 3e6103a
build: trigger build
maryia-deriv 25d505b
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv cad3ca4
fix: types in open-positions
maryia-deriv 57635f0
fix: address review comments about types
maryia-deriv beb1eef
Merge branch 'master' of github.com:binary-com/deriv-app into maryia/…
maryia-deriv 7e6a39f
Merge branch master of github.com:binary-com/deriv-app into maryia/87…
maryia-deriv c1a26e5
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv 35fa976
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv 3190fed
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv acfa962
Merge branch 'master' into maryia/87354/task-add-turbos
maryia-deriv 0e7727b
Merge branch master of github.com:binary-com/deriv-app into maryia/87…
maryia-deriv baaf7c3
refactor: type
maryia-deriv 7e58616
build: empty commit
maryia-deriv 4d5b6f3
Merge branch master of github.com:binary-com/deriv-app into maryia/87…
maryia-deriv 26ca75e
Merge branch master of github.com:binary-com/deriv-app into maryia/87…
maryia-deriv 356f891
Merge branch master of github.com:binary-com/deriv-app into maryia/87…
maryia-deriv 9185ac7
Merge branch master of github.com:binary-com/deriv-app into maryia/87…
maryia-deriv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
83 changes: 83 additions & 0 deletions
83
...ents/src/components/contract-card/contract-card-items/__tests__/turbos-card-body.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,83 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { render, screen } from '@testing-library/react'; | ||
import { TContractInfo } from '@deriv/shared/src/utils/contract/contract-types'; | ||
import TurbosCardBody from '../turbos-card-body'; | ||
|
||
const contract_info: TContractInfo = { | ||
contract_id: 1, | ||
bid_price: 1044.02, | ||
buy_price: 1044.0, | ||
profit: 50, | ||
barrier: '10904.80', | ||
entry_spot_display_value: '1046.80', | ||
sell_price: 1046.8, | ||
}; | ||
|
||
const mockCardLabels = () => ({ | ||
BARRIER: 'Barrier', | ||
CONTRACT_VALUE: 'Contract value', | ||
ENTRY_SPOT: 'Entry spot', | ||
TAKE_PROFIT: 'Take profit', | ||
TOTAL_PROFIT_LOSS: 'Total profit/loss', | ||
PURCHASE_PRICE: 'Buy price', | ||
}); | ||
|
||
describe('TurbosCardBody', () => { | ||
const mock_props = { | ||
addToast: jest.fn(), | ||
connectWithContractUpdate: jest.fn(), | ||
contract_info, | ||
contract_update: { | ||
take_profit: { | ||
display_name: 'Take profit', | ||
order_amount: 0, | ||
order_date: 1678948046, | ||
}, | ||
}, | ||
currency: 'USD', | ||
current_focus: null, | ||
error_message_alignment: 'left', | ||
getCardLabels: mockCardLabels, | ||
getContractById: jest.fn(), | ||
is_sold: false, | ||
onMouseLeave: jest.fn(), | ||
removeToast: jest.fn(), | ||
setCurrentFocus: jest.fn(), | ||
status: 'profit', | ||
progress_slider_mobile_el: false, | ||
}; | ||
beforeAll(() => { | ||
(ReactDOM.createPortal as jest.Mock) = jest.fn(component => { | ||
return component; | ||
}); | ||
}); | ||
|
||
it('renders header and values correctly', () => { | ||
render(<TurbosCardBody {...mock_props} />); | ||
const buy_price_header = screen.getByText(mockCardLabels().PURCHASE_PRICE); | ||
expect(buy_price_header).toBeInTheDocument(); | ||
const buy_price_amount = screen.getByText('1,044.00'); | ||
expect(buy_price_amount).toBeInTheDocument(); | ||
|
||
const entry_spot_header = screen.getByText(mockCardLabels().ENTRY_SPOT); | ||
expect(entry_spot_header).toBeInTheDocument(); | ||
const entry_spot_amount = screen.getByText('1,046.80'); | ||
expect(entry_spot_amount).toBeInTheDocument(); | ||
|
||
const barrier_header = screen.getByText(mockCardLabels().BARRIER); | ||
expect(barrier_header).toBeInTheDocument(); | ||
const barrier_level = screen.getByText('10,904.80'); | ||
expect(barrier_level).toBeInTheDocument(); | ||
|
||
const take_profit_header = screen.getByText(mockCardLabels().TAKE_PROFIT); | ||
expect(take_profit_header).toBeInTheDocument(); | ||
const take_profit_amount = screen.getByText('-'); | ||
expect(take_profit_amount).toBeInTheDocument(); | ||
|
||
const total_profit_loss_header = screen.getByText(mockCardLabels().TOTAL_PROFIT_LOSS); | ||
expect(total_profit_loss_header).toBeInTheDocument(); | ||
const total_profit_loss_amount = screen.getByText('50.00'); | ||
expect(total_profit_loss_amount).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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
this was breaking purchase button for all contracts in responsive