From dfc14b326fd688e9c55711300fc35c590ae0076c Mon Sep 17 00:00:00 2001 From: Simon van Lierde Date: Mon, 7 Sep 2026 08:26:47 +0200 Subject: [PATCH 1/2] fix(app): render interpolated button labels as one text node - AppButton wraps an all-primitive child run in a single Text, so "Select all ({count})" no longer splits into three gapped nodes - renovate: force vulnerabilityAlerts.enabled so alerts still raise PRs for the Expo-owned packages that are otherwise disabled - test setup: drop the unawaited manual cleanup(); RNTL 14 registers its own - test-utils/host: use container.queryAll instead of a hand-rolled walk that also returned the container --- .github/renovate.json | 3 ++- app/config/setup.shared.ts | 3 --- app/src/components/base/AppButton.tsx | 17 +++++++++++------ .../base/__tests__/AppButton.test.tsx | 17 +++++++++++++++++ app/src/test-utils/host.ts | 12 ++---------- 5 files changed, 32 insertions(+), 20 deletions(-) diff --git a/.github/renovate.json b/.github/renovate.json index 0a2dcae3..9d930f5d 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -12,7 +12,8 @@ "labels": ["dependencies"], "osvVulnerabilityAlerts": true, "vulnerabilityAlerts": { - "addLabels": ["security"] + "addLabels": ["security"], + "enabled": true }, "packageRules": [ { diff --git a/app/config/setup.shared.ts b/app/config/setup.shared.ts index b921c37b..1175929b 100644 --- a/app/config/setup.shared.ts +++ b/app/config/setup.shared.ts @@ -1,5 +1,4 @@ import { afterAll, afterEach, beforeEach, jest } from '@jest/globals'; -import { cleanup } from '@testing-library/react-native'; import type React from 'react'; import { server } from '@/test-utils/server'; @@ -30,11 +29,9 @@ beforeEach(() => server.listen({ onUnhandledRequest: 'error' })); afterEach(() => { server.resetHandlers(); server.close(); - cleanup(); jest.clearAllTimers(); }); afterAll(() => { - cleanup(); jest.clearAllTimers(); jest.useRealTimers(); server.close(); diff --git a/app/src/components/base/AppButton.tsx b/app/src/components/base/AppButton.tsx index 5b2e02b8..30c42e84 100644 --- a/app/src/components/base/AppButton.tsx +++ b/app/src/components/base/AppButton.tsx @@ -36,12 +36,17 @@ export function AppButton({ ...rest }: AppButtonProps) { const { colors } = useAppTheme(); - // Bare RN text nodes must live inside , and an interpolated label - // ("Select all ({count})") arrives as an array of them, not a single string. - // Wrap each primitive and leave element children alone. - const renderedChildren = Children.map(children, (child) => - typeof child === 'string' || typeof child === 'number' ? {child} : child, - ); + // Bare RN text nodes must live inside . An interpolated label + // ("Select all ({count})") arrives as an array of primitives; wrap the whole + // run in one so it stays a single node (no flex gaps, one a11y label). + const parts = Children.toArray(children); + const isPrimitive = (c: unknown) => typeof c === 'string' || typeof c === 'number'; + const renderedChildren = + parts.length > 0 && parts.every(isPrimitive) ? ( + {children} + ) : ( + Children.map(children, (child) => (isPrimitive(child) ? {child} : child)) + ); return (