From cb676d9c20478bb51fd9c2e478603a3ac5269197 Mon Sep 17 00:00:00 2001 From: Vojtech Novak Date: Mon, 7 Sep 2026 18:27:48 +0200 Subject: [PATCH] fix(ci): spy on the module the Android component resolves, trust wix/brew tap Jest resolves platform files as ios, so datetimepicker.android.js imports the DateTimePickerAndroid fallback module. The design-change test spied on the .android module, which the component never calls. Homebrew now refuses formulas from untrusted third-party taps, so trust wix/brew before installing applesimutils. Co-Authored-By: Claude Fable 5.1 --- .github/workflows/test.yml | 1 + test/index.test.js | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c8099754..1be00e23 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,6 +47,7 @@ jobs: - name: Install applesimutils run: | HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null + HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew trust wix/brew >/dev/null HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils >/dev/null - run: corepack enable - uses: actions/setup-node@v6 diff --git a/test/index.test.js b/test/index.test.js index 069b5f01..2bda1512 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -5,6 +5,8 @@ import RNDateTimePickerWindows, { } from '../src/datetimepicker.windows'; import RNDateTimePickerAndroid from '../src/datetimepicker.android'; import {DateTimePickerAndroid} from '../src/DateTimePickerAndroid.android'; +// jest resolves platform files as ios, so the component uses this fallback module +import {DateTimePickerAndroid as ResolvedDateTimePickerAndroid} from '../src/DateTimePickerAndroid'; import NativeDateTimePickerIOS from '../src/picker.ios'; import {render, fireEvent, waitFor} from '@testing-library/react-native'; import {EVENT_TYPE_SET} from '../src/constants'; @@ -80,13 +82,13 @@ describe('DateTimePicker', () => { expect(() => RNDateTimePickerAndroid(props)).toThrow(expected); }, ); - + it('reopens the picker when the design changes', () => { const open = jest - .spyOn(DateTimePickerAndroid, 'open') + .spyOn(ResolvedDateTimePickerAndroid, 'open') .mockImplementation(() => {}); jest - .spyOn(DateTimePickerAndroid, 'dismiss') + .spyOn(ResolvedDateTimePickerAndroid, 'dismiss') .mockImplementation(() => Promise.resolve(true)); const {rerender} = render(