Skip to content

Commit

Permalink
Revert "Revert "Akmal / feat: update entry spot description (binary-c…
Browse files Browse the repository at this point in the history
  • Loading branch information
balakrishna-deriv committed Apr 1, 2024
1 parent 5273ee0 commit e7c12ed
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 19 deletions.
Expand Up @@ -6,12 +6,10 @@ import { Localize } from '@deriv/translations';
const ContractTypeGlossary = ({
category,
is_vanilla_fx = false,
is_major_pairs = false,
is_multiplier_fx = false,
}: {
category: string;
is_vanilla_fx?: boolean;
is_major_pairs?: boolean;
is_multiplier_fx?: boolean;
}) => {
let content;
Expand Down Expand Up @@ -235,10 +233,8 @@ const ContractTypeGlossary = ({
{ type: 'heading', text: <Localize i18n_default_text='Entry spot' /> },
{
type: 'paragraph',
text: is_major_pairs ? (
<Localize i18n_default_text='We use next-tick-execution mechanism, which is the next asset price when the trade opening is processed by our servers for Major Pairs.' />
) : (
<Localize i18n_default_text='We use current-tick-execution mechanism, which is the latest asset price when the trade opening is processed by our servers for Volatility Index, Basket Indices, Jump Indices and Crash/Boom Indices.' />
text: (
<Localize i18n_default_text='We use next-tick-execution mechanism, which is the next asset price when the trade opening is processed by our servers.' />
),
},
{ type: 'heading', text: <Localize i18n_default_text='Exit spot' /> },
Expand Down
Expand Up @@ -6,7 +6,7 @@ import { localize } from '@deriv/translations';
import { Analytics } from '@deriv-com/analytics';
import TradeCategories from 'Assets/Trading/Categories/trade-categories';
import TradeCategoriesGIF from 'Assets/Trading/Categories/trade-categories-gif';
import { getContractTypes, isMajorPairsSymbol } from '../../../../Helpers/contract-type';
import { getContractTypes } from '../../../../Helpers/contract-type';
import ContractTypeGlossary from './contract-type-glossary';
import classNames from 'classnames';
import { useTraderStore } from 'Stores/useTraderStores';
Expand All @@ -31,9 +31,8 @@ const TABS = {
type TSelectedTab = 'description' | 'glossary';

const Info = observer(({ handleSelect, item, selected_value, list, info_banner }: TInfo) => {
const { cached_multiplier_cancellation_list, symbol } = useTraderStore();
const { cached_multiplier_cancellation_list } = useTraderStore();
const {
active_symbols: { active_symbols },
ui: { is_mobile },
modules: {
trade: { is_vanilla_fx },
Expand Down Expand Up @@ -131,7 +130,6 @@ const Info = observer(({ handleSelect, item, selected_value, list, info_banner }
category={type.value}
is_vanilla_fx={is_vanilla_fx}
is_multiplier_fx={!cached_multiplier_cancellation_list?.length}
is_major_pairs={isMajorPairsSymbol(symbol, active_symbols)}
/>
)}
</div>
Expand Down
Expand Up @@ -38,16 +38,8 @@ describe('<ContractTypeGlossary />', () => {
expect(screen.getByText(deal_cancellation)).toBeInTheDocument();
expect(screen.getByText(stop_out)).toBeInTheDocument();
});
it('Ensure TRADE_TYPES.MULTIPLIER glossary is rendered properly if it is multiplier_fx', () => {
render(<ContractTypeGlossary category={TRADE_TYPES.MULTIPLIER} is_multiplier_fx />);

expect(screen.queryByText(deal_cancellation)).not.toBeInTheDocument();
expect(screen.getByText(/current-tick-execution/i)).toBeInTheDocument();
expect(screen.queryByText(/next-tick-execution/i)).not.toBeInTheDocument();
expect(screen.getByText(stop_out)).toBeInTheDocument();
});
it('Ensure TRADE_TYPES.MULTIPLIER glossary is rendered properly if it is major pairs symbol and multiplier_fx', () => {
render(<ContractTypeGlossary category={TRADE_TYPES.MULTIPLIER} is_multiplier_fx is_major_pairs />);
render(<ContractTypeGlossary category={TRADE_TYPES.MULTIPLIER} is_multiplier_fx />);

expect(screen.queryByText(deal_cancellation)).not.toBeInTheDocument();
expect(screen.queryByText(/current-tick-execution/i)).not.toBeInTheDocument();
Expand Down

0 comments on commit e7c12ed

Please sign in to comment.