mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-21 23:53:52 +00:00
Migrate ProfitSymobl test to vitest
This commit is contained in:
parent
31dca96dae
commit
ca50318d09
|
@ -1,15 +0,0 @@
|
|||
import ProfitSymbol from '@/components/general/ProfitSymbol.vue';
|
||||
|
||||
describe('ProfitSymbol.vue', () => {
|
||||
it('calculates isProfitable with negative profit', () => {
|
||||
cy.mount(ProfitSymbol, { props: { profit: -0.5 } });
|
||||
|
||||
cy.get('div').should('have.class', 'triangle-down');
|
||||
cy.get('div').should('not.have.class', 'triangle-up');
|
||||
});
|
||||
it('calculates isProfitable with positive profit', () => {
|
||||
cy.mount(ProfitSymbol, { props: { profit: 0.5 } });
|
||||
cy.get('div').should('have.class', 'triangle-up');
|
||||
cy.get('div').should('not.have.class', 'triangle-down');
|
||||
});
|
||||
});
|
20
tests/component/ProfitSymbol.spec.ts
Normal file
20
tests/component/ProfitSymbol.spec.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
import ProfitSymbol from '@/components/general/ProfitSymbol.vue';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
describe('ProfitSymbol.vue', () => {
|
||||
it('calculates isProfitable with negative profit', () => {
|
||||
const wrapper = mount(ProfitSymbol, { props: { profit: -0.5 } });
|
||||
const divs = wrapper.findAll('div');
|
||||
expect(divs[1].classes()).toContain('triangle-down');
|
||||
expect(divs[1].classes()).not.toContain('triangle-up');
|
||||
});
|
||||
|
||||
it('calculates isProfitable with positive profit', () => {
|
||||
const wrapper = mount(ProfitSymbol, { props: { profit: 0.5 } });
|
||||
|
||||
const divs = wrapper.findAll('div');
|
||||
expect(divs[1].classes()).not.toContain('triangle-down');
|
||||
expect(divs[1].classes()).toContain('triangle-up');
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user