Merge pull request 'QLFW-67: «Эрудит» и «Книжный мир» — ссылка или пояснение' (#61) from task/qlfw-67 into main

This commit is contained in:
peppa-bot 2026-11-20 18:07:20 +05:00
commit fbb0974f13
4 changed files with 9 additions and 8 deletions

View File

@ -3,6 +3,8 @@ import { withPayload } from '@payloadcms/next/withPayload'
/** @type {import('next').NextConfig} */
const nextConfig = {
poweredByHeader: false,
// Сборка на слабом раннере упиралась в память (код 137): меньше потоков и экономия памяти webpack.
experimental: { webpackMemoryOptimizations: true, cpus: 1, workerThreads: false },
async redirects() {
return [{ source: '/', destination: '/ru', permanent: false }]
},

View File

@ -20,7 +20,7 @@ export function BookWhere({ t }: { t: Dict['book']; tbc?: string }) {
</ul>
<p className="mt-3 text-muted">{buy.storesIntro}</p>
<ul className="mt-3 list-disc space-y-1 pl-6 text-muted">
{buy.stores.map((p) => <li key={p}><Shop name={p} /></li>)}
{buy.stores.map((p) => <li key={p}>{p}</li>)}
</ul>
<p className="mt-3 text-muted">{buy.note}</p>
</div>

View File

@ -16,16 +16,17 @@ describe('Сценарий: где купить книгу', () => {
expect(html).toContain('можно приобрести онлайн на платформах:')
expect(html).toContain('href="https://www.marwin.kz/product/serkebaeva-i-ermek-serkebaev-i-zhizn-i-molodost-i-schaste-220988"')
expect(html).toContain('href="https://www.flip.kz/catalog?prod=6364653')
expect(html).toContain('href="https://erudit.kz/"')
expect(html).toContain('Книжный мир')
expect(html).toContain('<li>Эрудит</li>')
expect(html).toContain('<li>Книжный мир</li>')
expect(html).not.toContain('erudit.kz')
expect(html).toContain('<p class="mt-3 text-muted">Наличие и стоимость книги уточняйте непосредственно у продавцов.</p>')
})
it.each(['kk', 'en'] as const)('язык %s: те же магазины, без пометок', (l) => {
const html = render(l)
expect(html).toContain('href="https://www.marwin.kz/product/serkebaeva-i-ermek-serkebaev-i-zhizn-i-molodost-i-schaste-220988"')
expect(html).toContain('href="https://www.flip.kz/catalog?prod=6364653')
expect(html).toContain('Эрудит')
expect(html).toContain('Книжный мир')
expect(html).toContain('<li>Эрудит</li>')
expect(html).toContain('<li>Книжный мир</li>')
expect(html).not.toContain(getDict(l).tbc)
})
})

View File

@ -1,9 +1,7 @@
import { bookUrl } from './home-model'
/** Адреса магазинов, где продаётся книга. Ключ — название на экране. */
/** Адреса онлайн-площадок, где продаётся книга. Книжные магазины («Эрудит», «Книжный мир») — только текст, без ссылок (решение PM, QLFW-67). Ключ — название на экране. */
export const bookShopLinks: Record<string, string | null> = {
Marwin: 'https://www.marwin.kz/product/serkebaeva-i-ermek-serkebaev-i-zhizn-i-molodost-i-schaste-220988',
'Flip.kz': bookUrl,
'Эрудит': 'https://erudit.kz/',
'Книжный мир': null, // адрес не подтверждён — показываем без ссылки
}