Skip to content
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

Kate / OPT-306 / Update Accumulator to Accumulators #9577

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
grid-template-columns: 1.2fr 1fr;
&--accumulator {
display: flex;
grid-gap: 1px;
&-sold {
padding-top: 1rem;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export const getUnsupportedContracts = () => ({
export const getSupportedContracts = is_high_low => ({
ACCU: {
button_name: 'Buy',
name: 'Accumulator',
name: 'Accumulators',
position: 'top',
},
CALL: {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/Constants/contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export const getUnsupportedContracts = () => ({
export const getSupportedContracts = is_high_low => ({
ACCU: {
button_name: localize('Buy'),
name: localize('Accumulator'),
name: localize('Accumulators'),
position: 'top',
},
CALL: {
Expand Down
6 changes: 3 additions & 3 deletions packages/shared/src/utils/constants/contract.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { localize, Localize } from '@deriv/translations';
import { shouldShowCancellation, shouldShowExpiration } from '../contract';

export const getLocalizedBasis = () => ({
accumulator: localize('Accumulator'),
accumulator: localize('Accumulators'),
payout: localize('Payout'),
stake: localize('Stake'),
multiplier: localize('Multiplier'),
Expand Down Expand Up @@ -125,7 +125,7 @@ export const getContractTypesConfig: TGetContractTypesConfig = symbol => ({
components: [],
},
accumulator: {
title: localize('Accumulator'),
title: localize('Accumulators'),
trade_types: ['ACCU'],
basis: ['stake'],
components: ['take_profit', 'accumulator', 'accu_info_display'],
Expand Down Expand Up @@ -384,7 +384,7 @@ export const getUnsupportedContracts = () => ({
export const getSupportedContracts = (is_high_low?: boolean) => ({
ACCU: {
button_name: <Localize i18n_default_text='Buy' />,
name: <Localize i18n_default_text='Accumulator' />,
name: <Localize i18n_default_text='Accumulators' />,
position: 'top',
},
CALL: {
Expand Down
2 changes: 1 addition & 1 deletion packages/trader/src/Constants/contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export const getUnsupportedContracts = () => ({
export const getSupportedContracts = is_high_low => ({
ACCU: {
button_name: <Localize i18n_default_text='Buy' />,
name: <Localize i18n_default_text='Accumulator' />,
name: <Localize i18n_default_text='Accumulators' />,
position: 'top',
},
CALL: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import {
} from '../contract-type';

const contract_types_test_list = {
Accumulators: { name: 'Accumulators', categories: [{ value: 'accumulator', text: 'Accumulator' }] },
Accumulators: { name: 'Accumulators', categories: [{ value: 'accumulator', text: 'Accumulators' }] },
Digits: { name: 'Digits', categories: [{ value: 'match_diff', text: 'Matches/Differs' }] },
'Ins & Outs': { name: 'Ins & Outs', categories: [{ value: 'end', text: 'Ends In/Ends Out' }] },
};
const unsupported_test_list = ['end', 'stay'];
const unsupported_short_test_list = ['stay'];
const contract_type_array = [
{ value: 'accumulator', text: 'Accumulator' },
{ value: 'accumulator', text: 'Accumulators' },
{ value: 'rise_fall', text: 'Rise/Fall' },
];
const contract_category_list = [
Expand Down Expand Up @@ -55,10 +55,10 @@ describe('getContractTypeCategoryIcons', () => {

describe('getAvailableContractTypes', () => {
it('should return an object with specific availibale contracts if they are in the unsupported list', () => {
expect(getAvailableContractTypes(contract_types_test_list, unsupported_test_list).length).toEqual(2);
expect(getAvailableContractTypes(contract_types_test_list, unsupported_test_list)).toHaveLength(2);
});
it('should return an object with all availibale contracts if they are not in the unsupported list', () => {
expect(getAvailableContractTypes(contract_types_test_list, unsupported_short_test_list).length).toEqual(3);
expect(getAvailableContractTypes(contract_types_test_list, unsupported_short_test_list)).toHaveLength(3);
});
it('should return null for component field if it is not Accumulators', () => {
expect(getAvailableContractTypes(contract_types_test_list, unsupported_test_list)[1]?.component).toEqual(null);
Expand Down