feat(cms): hosting plans page with lifecycle gate and net + VAT prices (MITHOME-130)
CI Pipeline with Test Management / 🧪 Run Tests & Generate Reports (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 🧪 Run Tests & Generate Reports (push) Canceled after 0s
CI Pipeline with Test Management / 🐳 Docker Integration Tests (push) Canceled after 0s
CI Pipeline with Test Management / 🏗️ Build Docker Image (push) Canceled after 0s
CI Pipeline with Test Management / 📊 Generate Test Summary (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 📊 Analyze Test Coverage (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 🔄 Sync with Linear (push) Canceled after 0s
Test Reporting & Gherkin Analysis / ⚡ Performance Monitoring (push) Canceled after 0s
CI Pipeline with Test Management / 🧪 Run Tests & Generate Reports (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 🧪 Run Tests & Generate Reports (push) Canceled after 0s
CI Pipeline with Test Management / 🐳 Docker Integration Tests (push) Canceled after 0s
CI Pipeline with Test Management / 🏗️ Build Docker Image (push) Canceled after 0s
CI Pipeline with Test Management / 📊 Generate Test Summary (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 📊 Analyze Test Coverage (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 🔄 Sync with Linear (push) Canceled after 0s
Test Reporting & Gherkin Analysis / ⚡ Performance Monitoring (push) Canceled after 0s
- Products collection (interim mirror of the PLATFM-14 catalogue contract): lifecycle status, product type, required whole-forint net price, yearly billing, service definition, per-product English gate - HostingPlans global: page copy, comparison labels, VAT rate (27%) - Gate: production shows only active plans, staging all but retired; with no showable plan the page is 404 and left out of the menu and the sitemap - /hu/tarhely-csomagok <-> /en/hosting-plans via PAGE_SLUGS (hreflang, language switcher, CTA page picker) - Seed migration 20260929_hosting_plans: mIT Start (14 900 Ft/yr, 5 mailboxes) and mIT Mid (23 900 Ft/yr) as drafts, English AI draft; idempotent - Production SEO suite expects at least 12 sitemap URLs; new SMOKE-10 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
0c5888761b
commit
1e0742a548
@@ -0,0 +1,66 @@
|
||||
import { render, screen, within } from '@testing-library/react'
|
||||
import '@testing-library/jest-dom'
|
||||
import HostingPlansView from './HostingPlansView'
|
||||
import { HOSTING_PLANS_PAGE_COPY, pickLanguage } from '@/migrations/20260929_hosting_plans'
|
||||
import type { HostingPlanView } from '@/lib/products'
|
||||
|
||||
type Content = Parameters<typeof HostingPlansView>[0]['content']
|
||||
|
||||
const content = (lang: 'hu' | 'en') =>
|
||||
({ ...pickLanguage(HOSTING_PLANS_PAGE_COPY as never, lang), vatRatePercent: 27 }) as unknown as Content
|
||||
|
||||
const plan = (over: Partial<HostingPlanView>): HostingPlanView => ({
|
||||
id: 'start',
|
||||
slug: 'mit-start',
|
||||
name: 'mIT Start',
|
||||
highlighted: false,
|
||||
audience: 'Egyéni vállalkozóknak',
|
||||
shortDescription: 'Tárhely egy weboldalhoz.',
|
||||
features: ['Spamszűrés'],
|
||||
ctaText: 'Ezt választom',
|
||||
netAmount: 14900,
|
||||
billingPeriod: 'yearly',
|
||||
service: { storageGb: 3, mailStorageGb: 1, domains: 1, domainAliases: 0, databases: 1, mailboxes: 5, backup: 'Napi', ssl: true, spamFilter: true },
|
||||
...over,
|
||||
})
|
||||
|
||||
const PLANS = [plan({}), plan({ id: 'mid', slug: 'mit-mid', name: 'mIT Mid', highlighted: true, netAmount: 23900, service: { storageGb: 8, mailboxes: 10, ssl: true, spamFilter: true } })]
|
||||
|
||||
const text = (el: HTMLElement) => (el.textContent ?? '').replace(/\s/g, ' ')
|
||||
|
||||
describe('HostingPlansView (MITHOME-130)', () => {
|
||||
it('should show both plans as cards with their comparison rows', () => {
|
||||
render(<HostingPlansView content={content('hu')} plans={PLANS} locale="hu" />)
|
||||
expect(screen.getByRole('heading', { level: 1, name: 'Tárhelycsomagok' })).toBeInTheDocument()
|
||||
const start = screen.getByTestId('plan-mit-start')
|
||||
expect(within(start).getByRole('heading', { name: 'mIT Start' })).toBeInTheDocument()
|
||||
expect(text(start)).toContain('Tárhely összesen3 GB')
|
||||
expect(text(start)).toContain('E-mail-fiók (legfeljebb)5')
|
||||
expect(text(screen.getByTestId('plan-mit-mid'))).toContain('Tárhely összesen8 GB')
|
||||
})
|
||||
|
||||
it('should show the net price with VAT and the gross price per year', () => {
|
||||
render(<HostingPlansView content={content('hu')} plans={PLANS} locale="hu" />)
|
||||
const start = text(screen.getByTestId('plan-mit-start'))
|
||||
expect(start).toContain('14 900 Ft + ÁFA / év')
|
||||
expect(start).toContain('bruttó 18 923 Ft / év')
|
||||
expect(text(screen.getByTestId('plan-mit-mid'))).toContain('bruttó 30 353 Ft / év')
|
||||
})
|
||||
|
||||
it('should format the English page and mark only the highlighted plan', () => {
|
||||
render(<HostingPlansView content={content('en')} plans={PLANS} locale="en" />)
|
||||
expect(text(screen.getByTestId('plan-mit-start'))).toContain('14,900 Ft + VAT / year')
|
||||
expect(within(screen.getByTestId('plan-mit-mid')).getByText('Recommended')).toBeInTheDocument()
|
||||
expect(within(screen.getByTestId('plan-mit-start')).queryByText('Recommended')).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('should offer a custom quote only for larger needs, linking to the contact page', () => {
|
||||
render(<HostingPlansView content={content('hu')} plans={PLANS} locale="hu" />)
|
||||
expect(screen.getAllByText(/ajánlat/i)).toHaveLength(2) // larger-needs text + button, never a card
|
||||
expect(screen.getByRole('link', { name: 'Kérjen egyedi ajánlatot' })).toHaveAttribute('href', '/hu/kapcsolat')
|
||||
for (const card of [screen.getByTestId('plan-mit-start'), screen.getByTestId('plan-mit-mid')]) {
|
||||
expect(within(card).queryByText(/ajánlat/i)).not.toBeInTheDocument()
|
||||
expect(within(card).getByRole('link', { name: 'Ezt választom' })).toHaveAttribute('href', '/hu/kapcsolat')
|
||||
}
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user