Merge branch 'review/slice-2-recheck'
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # docs/phases/reviewed.md
This commit is contained in:
@@ -166,6 +166,41 @@ describe('renderPersonCard', () => {
|
||||
expect(root.querySelector('[data-card-tab="now"]')?.hasAttribute('hidden')).toBe(false);
|
||||
});
|
||||
|
||||
it('opens a relative from the overview family links', () => {
|
||||
setLocale('ru');
|
||||
const onRelative = vi.fn();
|
||||
const root = document.createElement('div');
|
||||
renderPersonCard(
|
||||
root,
|
||||
card({
|
||||
skills: [{ id: 'Mathematics', label: 'Математика', value: '62' }],
|
||||
traits: [{ defName: 'Diligent', label: 'Усидчивый' }],
|
||||
needs: [{ id: 'Sleep', label: 'Сон', value: 1 }],
|
||||
family: {
|
||||
parents: [{ id: 'f0.p0', fullName: 'Иванова Ольга', female: true }],
|
||||
children: [],
|
||||
siblings: [],
|
||||
partners: [],
|
||||
},
|
||||
}),
|
||||
onRelative,
|
||||
options(),
|
||||
);
|
||||
|
||||
const overview = root.querySelector('[data-card-tab="overview"]');
|
||||
expect(overview?.textContent).toContain('Рост');
|
||||
expect(overview?.textContent).toContain('Математика');
|
||||
expect(overview?.textContent).toContain('Усидчивый');
|
||||
expect(overview?.textContent).toContain('Сон');
|
||||
expect(overview?.textContent).toContain(t('peopleParents'));
|
||||
|
||||
const mother = overview?.querySelector('.people__link');
|
||||
expect(mother).toBeInstanceOf(HTMLButtonElement);
|
||||
expect(mother?.textContent).toBe('Иванова Ольга');
|
||||
(mother as HTMLButtonElement).click();
|
||||
expect(onRelative).toHaveBeenCalledWith('f0.p0');
|
||||
});
|
||||
|
||||
it('shows the server condition caption, not a band inferred from the number', () => {
|
||||
setLocale('ru');
|
||||
const root = document.createElement('div');
|
||||
|
||||
Reference in New Issue
Block a user