mirror of
https://github.com/freqtrade/frequi.git
synced 2024-09-20 09:31:10 +00:00
Add vue.nextTick to profitSymbol tests
This commit is contained in:
parent
ea918024fa
commit
86f0002263
|
@ -9,22 +9,20 @@ describe('ProfitSymbol.vue', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cmp = mount(ProfitSymbol, { propsData: { trade: {} } });
|
cmp = mount(ProfitSymbol, { propsData: { trade: {} } });
|
||||||
});
|
});
|
||||||
it('calculates isProfitable with negative profit', () => {
|
it('calculates isProfitable with negative profit', async () => {
|
||||||
const trade = {
|
const trade = {
|
||||||
profit_ratio: -0.5,
|
profit_ratio: -0.5,
|
||||||
};
|
};
|
||||||
cmp.setProps({ trade });
|
cmp.setProps({ trade });
|
||||||
|
await Vue.nextTick();
|
||||||
expect(cmp.vm.isProfitable).toBe(false);
|
expect(cmp.vm.isProfitable).toBe(false);
|
||||||
});
|
});
|
||||||
it('calculates isProfitable with positive profit', () => {
|
it('calculates isProfitable with positive profit', async () => {
|
||||||
const trade = {
|
const trade = {
|
||||||
close_profit: 0.5,
|
|
||||||
current_profit: 0.5,
|
|
||||||
profit_ratio: 0.5,
|
profit_ratio: 0.5,
|
||||||
};
|
};
|
||||||
cmp.setProps({ trade });
|
cmp.setProps({ trade });
|
||||||
|
await Vue.nextTick();
|
||||||
expect(cmp.vm.isProfitable).toBe(true);
|
expect(cmp.vm.isProfitable).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user