mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-22 19:15:15 +00:00
Fix botcomparison summary rendering
This commit is contained in:
parent
2705c62c20
commit
51834337f2
|
@ -81,9 +81,9 @@ export default defineComponent({
|
|||
botId: undefined,
|
||||
botName: 'Summary',
|
||||
profitClosed: 0,
|
||||
profitClosedRatio: 0,
|
||||
profitClosedRatio: undefined,
|
||||
profitOpen: 0,
|
||||
profitOpenRatio: 0,
|
||||
profitOpenRatio: undefined,
|
||||
stakeCurrency: 'USDT',
|
||||
wins: 0,
|
||||
losses: 0,
|
||||
|
|
|
@ -47,4 +47,19 @@ describe('ProfitPill.vue', () => {
|
|||
cy.get('div').should('contain', '(0)');
|
||||
cy.get('span').should('have.attr', 'title', 'BTC');
|
||||
});
|
||||
it('Shows a pill without relative profits.', async () => {
|
||||
mount(ProfitPill, {
|
||||
propsData: {
|
||||
profitRatio: undefined,
|
||||
profitAbs: 223,
|
||||
profitDesc: '',
|
||||
stakeCurrency: 'USDT',
|
||||
},
|
||||
});
|
||||
|
||||
cy.get('div').should('have.class', 'profit-pill').should('be.visible');
|
||||
// cy.get('div').should('not.contain', '%');
|
||||
cy.get('div').should('contain', '223');
|
||||
cy.get('span').should('have.attr', 'title', 'USDT');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -46,6 +46,8 @@ export default defineComponent({
|
|||
const profitString = computed((): string => {
|
||||
if (props.profitRatio !== undefined && props.profitAbs !== undefined) {
|
||||
return `(${formatPrice(props.profitAbs, 3)})`;
|
||||
} else if (props.profitAbs !== undefined) {
|
||||
return `${formatPrice(props.profitAbs, 3)}`;
|
||||
}
|
||||
return '';
|
||||
});
|
||||
|
|
|
@ -3,9 +3,9 @@ export interface ComparisonTableItems {
|
|||
botName: string;
|
||||
trades?: string;
|
||||
profitClosed: number;
|
||||
profitClosedRatio: number;
|
||||
profitClosedRatio?: number;
|
||||
profitOpen: number;
|
||||
profitOpenRatio: number;
|
||||
profitOpenRatio?: number;
|
||||
stakeCurrency: string;
|
||||
wins: number;
|
||||
losses: number;
|
||||
|
|
Loading…
Reference in New Issue
Block a user