Skip to content

Commit 78b3e75

Browse files
authored
Merge branch 'main' into feat/musd-455-bring-back-claim-section-on-asset-details-screen
2 parents 6b9f081 + 36b4602 commit 78b3e75

163 files changed

Lines changed: 6343 additions & 3817 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/component-view-test/SKILL.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ tests/component-view/
5656
├── mocks.ts ← Engine + native mocks (import this first, always)
5757
├── render.tsx ← renderComponentViewScreen, renderScreenWithRoutes
5858
├── stateFixture.ts ← StateFixtureBuilder (createStateFixture)
59+
├── platform.ts ← describeForPlatforms, itForPlatforms (run per iOS/Android)
5960
├── api-mocking/ ← HTTP API mocks (nock) — extensible, one file per feature
6061
├── presets/ ← initialState<Feature>() builders — one file per feature area
6162
└── renderers/ ← render<Feature>View() functions — one file per feature area

.agents/skills/component-view-test/references/writing-tests.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,38 @@ const defaultBridgeWithTokens = (overrides?: Record<string, unknown>) => {
195195

196196
Then each test only specifies its delta from this baseline.
197197

198+
### describe / it and platform (iOS + Android)
199+
200+
Import from `tests/component-view/platform`. All helpers accept an optional **filter** (3rd arg): `'ios'` | `'android'` | `['ios','android']` | `{ only: 'ios' }` | `{ skip: ['android'] }`. Env: `TEST_OS=ios` or `TEST_OS=android` to run only one OS.
201+
202+
| Helper | Use |
203+
| ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
204+
| `describeForPlatforms(name, define, filter?)` | One describe per OS. Inside, `define({ os })`; use `it()` or `itForPlatforms()` — each runs once per that OS. |
205+
| `itForPlatforms(name, (ctx) => {}, filter?)` | One `it` per OS. Callback receives `{ os }`. |
206+
| `itOnlyForPlatforms(name, fn, filter?)` | Same as `itForPlatforms` but registers `it.only`. |
207+
| `itEach(table)(name, (row) => {}, filter?)` | One `it` per table row × per OS. Use `$key` in name to interpolate row fields. |
208+
| `describeEach(table)(name, (row) => { it('...', () => {}); }, filter?)` | One describe per row × per OS. Use `$key` in name. |
209+
| `getTargetPlatforms(filter?)` | Returns `['ios','android']` (or filtered list) for custom loops. |
210+
211+
Example — `itEach` (each case runs on iOS and Android):
212+
213+
```typescript
214+
import { itEach } from '../../../../../../tests/component-view/platform';
215+
216+
const cases = [
217+
{ name: 'renders empty', amount: '0' },
218+
{ name: 'displays fiat', amount: '1' },
219+
];
220+
itEach(cases)('$name', ({ amount }) => {
221+
const { findByDisplayValue } = renderDefault({
222+
bridge: { sourceAmount: amount },
223+
});
224+
expect(findByDisplayValue(amount)).toBeOnTheScreen();
225+
});
226+
```
227+
228+
Jest modifiers (`it.only`, `it.skip`, `describe.only`, `describe.skip`) work as usual inside these blocks.
229+
198230
### Minimal template
199231

200232
```typescript

.github/workflows/nightly-build.yml

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ name: Nightly Build
77
# [skip ci] commits (e.g. version bumps pushed via update-latest-build-version.yml)
88
# are automatically skipped by GitHub Actions, so this workflow will NOT
99
# double-trigger on those commits.
10+
#
11+
# Version strategy: exp and rc builds share the same bundle ID (MetaMask) so
12+
# TestFlight requires unique CFBundleVersion per upload. We call the external
13+
# version generator once (→ version N for exp), then locally increment to N+1
14+
# for the rc build. Both builds run in parallel after their respective bumps.
1015

1116
on:
1217
push:
@@ -20,8 +25,8 @@ permissions:
2025
id-token: write
2126

2227
jobs:
23-
bump-version:
24-
name: Bump build version
28+
bump-version-exp:
29+
name: Bump build version (exp)
2530
uses: ./.github/workflows/update-latest-build-version.yml
2631
permissions:
2732
contents: write
@@ -30,26 +35,59 @@ jobs:
3035
base-branch: ${{ github.ref_name }}
3136
secrets: inherit
3237

38+
bump-version-rc:
39+
name: Bump build version (rc)
40+
needs: [bump-version-exp]
41+
runs-on: ubuntu-latest
42+
permissions:
43+
contents: write
44+
outputs:
45+
commit-hash: ${{ steps.bump.outputs.commit-hash }}
46+
build-version: ${{ steps.bump.outputs.build-version }}
47+
steps:
48+
- uses: actions/checkout@v4
49+
with:
50+
ref: ${{ needs.bump-version-exp.outputs.commit-hash }}
51+
fetch-depth: 0
52+
token: ${{ secrets.PR_TOKEN || github.token }}
53+
54+
- name: Increment version for RC build
55+
id: bump
56+
env:
57+
EXP_VERSION: ${{ needs.bump-version-exp.outputs.build-version }}
58+
HEAD_REF: ${{ github.ref_name }}
59+
run: |
60+
RC_VERSION=$((EXP_VERSION + 1))
61+
echo "Exp version: $EXP_VERSION → RC version: $RC_VERSION"
62+
./scripts/set-build-version.sh "$RC_VERSION"
63+
git config user.name metamaskbot
64+
git config user.email metamaskbot@users.noreply.github.com
65+
git add bitrise.yml package.json ios/MetaMask.xcodeproj/project.pbxproj android/app/build.gradle
66+
git commit -m "[skip ci] Bump version number to ${RC_VERSION} (nightly rc)"
67+
git push origin HEAD:"$HEAD_REF" --force-with-lease
68+
echo "commit-hash=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
69+
echo "build-version=$RC_VERSION" >> "$GITHUB_OUTPUT"
70+
3371
build-exp:
3472
name: Nightly exp build (main-exp)
35-
needs: [bump-version]
73+
needs: [bump-version-exp]
3674
uses: ./.github/workflows/build.yml
3775
with:
3876
build_name: main-exp
3977
platform: both
4078
skip_version_bump: true
41-
ref: ${{ needs.bump-version.outputs.commit-hash }}
79+
ref: ${{ needs.bump-version-exp.outputs.commit-hash }}
4280
secrets: inherit
4381

4482
build-rc:
4583
name: Nightly RC build (main-rc)
46-
needs: [bump-version]
84+
needs: [bump-version-rc]
4785
uses: ./.github/workflows/build.yml
4886
with:
4987
build_name: main-rc
5088
platform: both
5189
skip_version_bump: true
52-
ref: ${{ needs.bump-version.outputs.commit-hash }}
90+
ref: ${{ needs.bump-version-rc.outputs.commit-hash }}
5391
secrets: inherit
5492

5593
upload-exp-testflight:

app/actions/onboarding/index.test.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,32 @@ describe('Onboarding actions', () => {
4646

4747
describe('setAccountType', () => {
4848
it('creates an action to set accountType', () => {
49-
expect(setAccountType(AccountType.Metamask)).toEqual({
49+
const onboardingVersion = '7.0.0 (1234)';
50+
51+
expect(
52+
setAccountType({
53+
accountType: AccountType.Metamask,
54+
onboardingVersion,
55+
}),
56+
).toEqual({
5057
type: SET_ACCOUNT_TYPE,
5158
accountType: AccountType.Metamask,
59+
onboardingVersion,
5260
});
5361
});
5462

5563
it('creates an action with social login account type', () => {
56-
expect(setAccountType(AccountType.MetamaskGoogle)).toEqual({
64+
const onboardingVersion = '7.0.0 (1234)';
65+
66+
expect(
67+
setAccountType({
68+
accountType: AccountType.MetamaskGoogle,
69+
onboardingVersion,
70+
}),
71+
).toEqual({
5772
type: SET_ACCOUNT_TYPE,
5873
accountType: AccountType.MetamaskGoogle,
74+
onboardingVersion,
5975
});
6076
});
6177
});

app/actions/onboarding/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export interface SetCompletedOnboardingAction {
2424
interface SetAccountTypeAction {
2525
type: typeof SET_ACCOUNT_TYPE;
2626
accountType: AccountType;
27+
onboardingVersion: string;
2728
}
2829

2930
interface ClearAccountTypeAction {
@@ -61,10 +62,14 @@ export function setCompletedOnboarding(
6162
};
6263
}
6364

64-
export function setAccountType(accountType: AccountType): SetAccountTypeAction {
65+
export function setAccountType(params: {
66+
accountType: AccountType;
67+
onboardingVersion: string;
68+
}): SetAccountTypeAction {
6569
return {
6670
type: SET_ACCOUNT_TYPE,
67-
accountType,
71+
accountType: params.accountType,
72+
onboardingVersion: params.onboardingVersion,
6873
};
6974
}
7075

0 commit comments

Comments
 (0)