fix/deals: реальное время сделки в шапке карточки V1 вместо захардкоженных 28 мин
Шапка показывала formatRelative(28) — всегда 28 мин назад у любой сделки. Теперь deal.receivedMinutesAgo. Тест DealDetailHero 13/13. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -43,7 +43,7 @@ function formatRelative(minutes: number): string {
|
||||
<span class="sep">·</span>
|
||||
<span class="text-caption text-medium-emphasis">
|
||||
<v-icon size="14" class="mr-1">mdi-clock-outline</v-icon>
|
||||
{{ formatRelative(28) }}
|
||||
{{ formatRelative(deal.receivedMinutesAgo) }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -36,6 +36,25 @@ describe('DealDetailHero — inline status picker (18.05.2026)', () => {
|
||||
expect(w.find('[data-testid="status-chip-trigger"]').exists()).toBe(true);
|
||||
});
|
||||
|
||||
// V1 (UX-аудит 25.06): время было захардкожено formatRelative(28) — шапка всегда
|
||||
// показывала «28 мин назад». Теперь берём реальное deal.receivedMinutesAgo.
|
||||
it('показывает реальное время сделки, не захардкоженные 28 мин', () => {
|
||||
const w = mount(DealDetailHero, {
|
||||
props: { deal: makeDeal({ receivedMinutesAgo: 3 }), status: statuses[0] },
|
||||
global: { plugins: [vuetify] },
|
||||
});
|
||||
expect(w.text()).toContain('3 мин назад');
|
||||
expect(w.text()).not.toContain('28 мин назад');
|
||||
});
|
||||
|
||||
it('реальное время в часах при больших значениях', () => {
|
||||
const w = mount(DealDetailHero, {
|
||||
props: { deal: makeDeal({ receivedMinutesAgo: 125 }), status: statuses[0] },
|
||||
global: { plugins: [vuetify] },
|
||||
});
|
||||
expect(w.text()).toContain('2 ч назад');
|
||||
});
|
||||
|
||||
it('клик по chip открывает меню (data-testid="status-option-{slug}" появляются)', async () => {
|
||||
const w = mount(DealDetailHero, {
|
||||
props: { deal: makeDeal(), status: statuses[0], allStatuses: statuses },
|
||||
|
||||
Reference in New Issue
Block a user