Files
Nikita Kiselev 3cc82e45f0
Some checks are pending
Telegram Mini App Shop Builder / Compute version metadata (push) Waiting to run
Telegram Mini App Shop Builder / Run Frontend tests (push) Waiting to run
Telegram Mini App Shop Builder / Run Backend tests (push) Waiting to run
Telegram Mini App Shop Builder / Run PHP_CodeSniffer (push) Waiting to run
Telegram Mini App Shop Builder / Build module. (push) Blocked by required conditions
Telegram Mini App Shop Builder / release (push) Blocked by required conditions
Squashed commit message
2026-03-11 23:02:54 +03:00

46 lines
1.1 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { describe, it, expect } from 'vitest';
import { mount } from '@vue/test-utils';
import Price from '@/components/Price.vue';
describe('Price.vue', () => {
it('должен отображать цену с символом рубля', () => {
const wrapper = mount(Price, {
props: {
value: 1000,
},
});
expect(wrapper.text()).toContain('₽');
expect(wrapper.text()).toContain('1 000');
});
it('должен использовать значение по умолчанию 0', () => {
const wrapper = mount(Price, {
props: {},
});
expect(wrapper.text()).toContain('₽');
});
it('должен форматировать большие числа', () => {
const wrapper = mount(Price, {
props: {
value: 1234567,
},
});
expect(wrapper.text()).toContain('1 234 567');
});
it('должен обрабатывать нулевое значение', () => {
const wrapper = mount(Price, {
props: {
value: 0,
},
});
expect(wrapper.text()).toContain('₽');
});
});