mirror of
https://github.com/bulwarkmail/native.git
synced 2026-11-01 08:06:13 +00:00
test: follow the drawer's unread label helper and the sheet inset hook
This commit is contained in:
@@ -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\}/);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user