QLFW-75: пробелы в подписях формы #56
@ -44,7 +44,7 @@ export function ContactForm({ t, locale, email, dark = false, privacyLink = fals
|
||||
<input name="email" type="email" autoComplete="email" required maxLength={200} className={field} {...bad('email')} />
|
||||
{err('email')}
|
||||
</label>
|
||||
<label className="block">{f.organization} <span className={hint}>({f.optional})</span>
|
||||
<label className="block">{f.organization} <span className={hint}>{`(${f.optional})`}</span>
|
||||
<input name="organization" type="text" autoComplete="organization" maxLength={200} className={field} />
|
||||
</label>
|
||||
<label className="block">{f.message}
|
||||
|
||||
18
src/components/contact-form-spacing.test.ts
Normal file
18
src/components/contact-form-spacing.test.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import { createElement } from 'react'
|
||||
import { renderToStaticMarkup } from 'react-dom/server'
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { getDict, locales } from '@/i18n'
|
||||
import { ContactForm } from './ContactForm'
|
||||
|
||||
vi.mock('@/app/actions/inquiry', () => ({ submitInquiry: vi.fn() }))
|
||||
|
||||
describe('Пробелы в подписях формы', () => {
|
||||
for (const locale of locales) {
|
||||
it(`Скобки без пробелов внутри, точка сразу после ссылки (${locale})`, () => {
|
||||
const t = getDict(locale)
|
||||
const html = renderToStaticMarkup(createElement(ContactForm, { t, locale, email: 'a@example.com', privacyLink: true }))
|
||||
expect(html).toContain(`>(${t.form.optional})</span>`)
|
||||
expect(html).toContain(`${t.form.consentPolicyLink}</a>${t.form.consentPolicyAfter}</span>`)
|
||||
})
|
||||
}
|
||||
})
|
||||
Loading…
Reference in New Issue
Block a user