diff --git a/frontend/src/components/PhotoStartPanel.jsx b/frontend/src/components/PhotoStartPanel.jsx index 1d15756..7df1f2d 100644 --- a/frontend/src/components/PhotoStartPanel.jsx +++ b/frontend/src/components/PhotoStartPanel.jsx @@ -5,6 +5,7 @@ import PzBusy from './PzBusy.jsx' import { t } from '../i18n/index.js' import { matchPhotoFiles } from '../utils/photoImport.js' import { materializeFile } from '../utils/zipReader.js' +import { initialsOf } from '../utils/initial.js' function withEmphasis(text) { const [before, emphasized = '', after = ''] = text.split(/<\/?em>/) @@ -21,10 +22,6 @@ function plural(n, one, many, vars = {}) { return n === 1 ? t(one, vars) : t(many, { n, ...vars }) } -function initialsOf(person) { - return initialsOf(person) -} - // Dossier où le logiciel d'origine rangeait la première photo citée, pour aider à le retrouver function folderOf(filePath) { const parts = String(filePath || '').split(/([\\/])/) diff --git a/frontend/src/components/PhotoStartPanel.test.jsx b/frontend/src/components/PhotoStartPanel.test.jsx new file mode 100644 index 0000000..82ca878 --- /dev/null +++ b/frontend/src/components/PhotoStartPanel.test.jsx @@ -0,0 +1,22 @@ +import { renderToStaticMarkup } from 'react-dom/server' +import { describe, expect, it } from 'vitest' +import PhotoStartPanel from './PhotoStartPanel.jsx' + +// Les visages à compléter, sans aperçu : chaque portrait vide montre les initiales de la personne +describe('PhotoStartPanel, visages sans photo', () => { + it('affiche les initiales, une seule pour un nom chinois', () => { + const html = renderToStaticMarkup( + {}} + />, + ) + expect(html).toContain('>JD') + expect(html).toContain('>王') + }) +})