mirror of
https://github.com/IliesAllali/parenthese.git
synced 2026-11-09 15:50:58 +00:00
Premiers visages : import de initialsOf, la fonction locale s'appelait elle-même ; test du panneau sans aperçu
This commit is contained in:
1 parent
01ed08d26f
commit
bb6ec09fd1
2 files changed
+23
-4
No files matched your search
@@ -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(/([\\/])/)
|
||||
|
||||
@@ -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(
|
||||
<PhotoStartPanel
|
||||
visible
|
||||
personsImported={2}
|
||||
faces={[
|
||||
{ id: 'a', firstName: 'Jeanne', lastName: 'Duval', birthYear: 1950 },
|
||||
{ id: 'b', firstName: '小明', lastName: '王', birthYear: 1978 },
|
||||
]}
|
||||
onClose={() => {}}
|
||||
/>,
|
||||
)
|
||||
expect(html).toContain('>JD</span>')
|
||||
expect(html).toContain('>王</span>')
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user