test: follow the drawer's unread label helper and the sheet inset hook

This commit is contained in:
Linus Rath
2026-10-31 14:46:40 +01:00
parent 36cc49b706
commit 77914b0a46
2 changed files with 4 additions and 1 deletions
@@ -8,6 +8,7 @@ import { describe, it, expect, vi } from 'vitest';
vi.mock('../icons', () => ({ Check: () => null, Plus: () => null, X: () => null }));
vi.mock('../Button', () => ({ default: () => null }));
vi.mock('../../lib/use-layout', () => ({ useSheetInsets: () => ({}) }));
vi.mock('../../lib/sheet-bottom-inset', () => ({ useSheetBottomInset: () => 0 }));
vi.mock('../../theme/colors', () => ({ useColors: () => ({}) }));
import type { Alert } from '../../api/types';
@@ -10,7 +10,9 @@ describe('folder list names', () => {
it('marks the open folder as selected and says its unread count with its name', () => {
expect(src).toMatch(/accessibilityState=\{isAccountHeader \? undefined : \{ selected: isSelected \}\}/);
expect(src).toMatch(/t\('shell\.name_unread', '\{name\}, \{count\} unread', \{ name: label, count: unread \}\)/);
expect(src).toMatch(/const accessibleName = isAccountHeader \? label : unreadRowLabel\(label, unread, t\)/);
const helper = fs.readFileSync(path.resolve(__dirname, '../../lib/unread-row-label.ts'), 'utf8');
expect(helper).toMatch(/t\('shell\.name_unread', '\{name\}, \{count\} unread', \{ name, count: unread \}\)/);
expect(src).toMatch(/accessibilityLabel=\{accessibleName\}/);
});