import { createElement } from 'react' import { renderToStaticMarkup } from 'react-dom/server' import { describe, expect, it } from 'vitest' import { getDict } from '@/i18n' import { BookWhere } from './BookWhere' const render = (l: 'ru' | 'kk' | 'en') => { const d = getDict(l) return renderToStaticMarkup(createElement(BookWhere, { t: d.book, tbc: d.tbc })) } describe('Сценарий: где купить книгу', () => { it('русский текст целиком, площадки списком без ссылок', () => { const html = render('ru') expect(html).toContain('Где купить книгу') expect(html).toContain('можно приобрести онлайн на платформах:') expect(html).toContain('
  • Marwin
  • Flip.kz
  • ') expect(html).toContain('

    Наличие и стоимость книги уточняйте непосредственно у продавцов.

    ') expect(html).not.toContain(' { const html = render(l) expect(html).toContain('
  • Marwin
  • Flip.kz
  • ') expect(html).toContain('Эрудит') expect(html).toContain('Книжный мир') expect(html).not.toContain(getDict(l).tbc) expect(html).not.toContain('