Repository navigation
feat: Add more features and tests to MF2 test app #1514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dannyhw
merged 34 commits into
callstack:main
from
MrMuzyk:add-more-features-to-mf2-testing-app
Nov 16, 2026
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
6ff87a3
ci: temp e2e workflow
MrMuzyk c5fa84d
Merge branch 'callstack:main' into main
MrMuzyk 4feac60
feat: repack e2e tests
MrMuzyk e0a0ea5
Merge branch 'main' into e2e-ci
MrMuzyk 0254419
fix: CR fixes
MrMuzyk da3f15e
fix: pin ruby
MrMuzyk 53bca6d
fix: warn
MrMuzyk 62fd861
fix: cr fixes v2
MrMuzyk 31c9af0
feat: More features in MF2 test app
MrMuzyk b8b4207
Merge branch 'main' of github.com:MrMuzyk/repack into e2e-ci
MrMuzyk 144812f
fix: lock
MrMuzyk e010c48
Merge branch 'e2e-ci' of github.com:MrMuzyk/repack into add-more-feat…
MrMuzyk 46a7e94
feat: plugins
MrMuzyk dde9e4c
fix: prettier
MrMuzyk f84e401
Merge branch 'main' of github.com:MrMuzyk/repack into add-more-featur…
MrMuzyk 4354599
fix: ids
MrMuzyk 1612757
feat: assets tests
MrMuzyk e78ecbc
fix: prettier
MrMuzyk 1ffeb98
feat: svgr
MrMuzyk 9139910
fix: configs
MrMuzyk cae130c
feat: design doc and some cleanup of duplicated tests
MrMuzyk 5bb638f
fix: final touches
MrMuzyk d2074ff
fix: timeout as android is slower
MrMuzyk 351a1ef
fix: reduce motion warning
MrMuzyk 746a7d5
fix: failing android run
MrMuzyk 66a9047
fix: added some missing debugging logs and fixed some minor stuff
MrMuzyk fff3824
Merge branch 'main' into add-more-features-to-mf2-testing-app
MrMuzyk a28beee
Merge branch 'main' into add-more-features-to-mf2-testing-app
MrMuzyk b2772fe
Merge branch 'main' into add-more-features-to-mf2-testing-app
MrMuzyk 6578beb
fix: CR fixes
MrMuzyk a2d0ac3
Merge branch 'main' into add-more-features-to-mf2-testing-app
MrMuzyk 4db27ce
Merge branch 'add-more-features-to-mf2-testing-app' of github.com:MrM…
MrMuzyk ff52ef6
fix: ReanimatedBox
MrMuzyk 9c28bcf
fix: CR fixes v2
MrMuzyk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,18 @@ | ||
| module.exports = { | ||
| presets: ['module:@react-native/babel-preset'], | ||
| plugins: ['react-native-worklets/plugin'], | ||
| comments: true, | ||
| overrides: [ | ||
| { | ||
| // Regex instead of a relative string: babel resolves strings against the | ||
| // launch cwd, and the rspack CLI launches from the repo root. | ||
| test: /[\\/]src[\\/]host[\\/]/, | ||
| plugins: [ | ||
| [ | ||
| '@babel/plugin-transform-react-jsx', | ||
| { runtime: 'automatic', importSource: 'nativewind' }, | ||
| ], | ||
| ], | ||
| }, | ||
| ], | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| import path from 'node:path'; | ||
| import * as Repack from '@callstack/repack'; | ||
|
|
||
| const BITMAP_EXTENSIONS = Repack.getAssetExtensionsRegExp( | ||
| Repack.ASSET_EXTENSIONS.filter((ext) => ext !== 'svg') | ||
| ); | ||
|
|
||
| export function buildHostAssetRules(context: string) { | ||
| const localAssets = path.join(context, 'src/host/assets/localAssets'); | ||
| const inlineAssets = path.join(context, 'src/host/assets/inlineAssets'); | ||
|
|
||
| return [ | ||
| { | ||
| test: BITMAP_EXTENSIONS, | ||
| exclude: [localAssets, inlineAssets], | ||
| use: { | ||
| loader: '@callstack/repack/assets-loader', | ||
| options: { inline: true, maxInlineSize: 90 * 1024 }, | ||
| }, | ||
| }, | ||
| { | ||
| test: /\.svg$/, | ||
| use: [ | ||
| { | ||
| loader: '@svgr/webpack', | ||
| options: { native: true, dimensions: false }, | ||
| }, | ||
| ], | ||
| }, | ||
| { | ||
| test: BITMAP_EXTENSIONS, | ||
| include: [localAssets], | ||
| use: '@callstack/repack/assets-loader', | ||
| }, | ||
| { | ||
| test: BITMAP_EXTENSIONS, | ||
| include: [inlineAssets], | ||
| use: { | ||
| loader: '@callstack/repack/assets-loader', | ||
| options: { inline: true }, | ||
| }, | ||
| }, | ||
| ]; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import { test } from '@e2e-dev/mobile'; | ||
| import { expect } from 'e2e'; | ||
|
|
||
| test('Async chunk loads through ScriptManager and renders', async ({ | ||
| app, | ||
| screen, | ||
| }) => { | ||
| await app.open(); | ||
| await expect(screen.getByTestId('home-screen')).toBeVisible({ | ||
| timeout: 30_000, | ||
| }); | ||
|
|
||
| const entry = screen.getByTestId('home-async-chunk-button'); | ||
| await screen.scrollUntilVisible(entry); | ||
| await entry.tap(); | ||
| await expect(screen.getByTestId('async-chunk-screen')).toBeVisible(); | ||
|
|
||
| await expect(screen.getByTestId('async-chunk-content')).toBeVisible(); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import { test } from '@e2e-dev/mobile'; | ||
| import { expect } from 'e2e'; | ||
|
|
||
| test('Gallery MiniApp loads and renders its own navigator', async ({ | ||
| app, | ||
| screen, | ||
| }) => { | ||
| await app.open(); | ||
| await expect(screen.getByTestId('home-screen')).toBeVisible({ | ||
| timeout: 30_000, | ||
| }); | ||
|
|
||
| const entry = screen.getByTestId('home-gallery-button'); | ||
| await screen.scrollUntilVisible(entry); | ||
| await entry.tap(); | ||
|
|
||
| await expect(screen.getByTestId('miniapp-gallery')).toBeVisible({ | ||
| timeout: 45_000, | ||
| }); | ||
| await expect(screen.getByText('Picture 1')).toBeVisible(); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| import { test } from '@e2e-dev/mobile'; | ||
| import { expect } from 'e2e'; | ||
|
|
||
| test('Host Assets screen renders', async ({ app, screen }) => { | ||
| await app.open(); | ||
| await expect(screen.getByTestId('home-screen')).toBeVisible({ | ||
| timeout: 30_000, | ||
| }); | ||
|
|
||
| const entry = screen.getByTestId('home-host-assets-button'); | ||
| await screen.scrollUntilVisible(entry); | ||
| await entry.tap(); | ||
| await expect(screen.getByTestId('host-assets-screen')).toBeVisible(); | ||
|
|
||
| const pic1Mode = screen.getByTestId('host-asset-pic-1-mode-report'); | ||
| const pic2Mode = screen.getByTestId('host-asset-pic-2-mode-report'); | ||
| const localMode = screen.getByTestId('host-asset-local-mode-report'); | ||
| const inlineMode = screen.getByTestId('host-asset-inline-mode-report'); | ||
| const localUri = screen.getByTestId('host-asset-local-uri-report'); | ||
|
|
||
| await screen.scrollUntilVisible(pic1Mode); | ||
| await expect(pic1Mode).toHaveText('mode: Inlined'); | ||
| await screen.scrollUntilVisible(pic2Mode); | ||
| await expect(pic2Mode).toHaveText('mode: Emitted'); | ||
| await screen.scrollUntilVisible(localMode); | ||
| await expect(localMode).toHaveText('mode: Emitted'); | ||
| await screen.scrollUntilVisible(inlineMode); | ||
| await expect(inlineMode).toHaveText('mode: Inlined'); | ||
|
|
||
| await screen.scrollUntilVisible(localUri); | ||
| const uriText = (await localUri.textContent()) ?? ''; | ||
| const assetUrl = new URL(uriText.slice('uri: '.length)); | ||
| expect(assetUrl.protocol).toBe('http:'); | ||
| expect(assetUrl.port).toBe('8081'); | ||
| // Android resolves the dev server as 10.0.2.2 and iOS as localhost | ||
| expect(['localhost', '10.0.2.2']).toContain(assetUrl.hostname); | ||
|
|
||
| const probeHost = | ||
| assetUrl.hostname === '10.0.2.2' ? 'localhost' : assetUrl.hostname; | ||
| const response = await fetch( | ||
| `${assetUrl.protocol}//${probeHost}:${assetUrl.port}${assetUrl.pathname}${assetUrl.search}` | ||
| ); | ||
| expect(response.status).toBe(200); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import { test } from '@e2e-dev/mobile'; | ||
| import { expect } from 'e2e'; | ||
|
|
||
| test('install the host mini-app chunk and clear its cache', async ({ | ||
| app, | ||
| screen, | ||
| }) => { | ||
| await app.open(); | ||
| await expect(screen.getByTestId('home-screen')).toBeVisible({ | ||
| timeout: 30_000, | ||
| }); | ||
|
|
||
| const entry = screen.getByTestId('home-miniapp-install-button'); | ||
| await screen.scrollUntilVisible(entry); | ||
| await entry.tap(); | ||
| await expect(screen.getByTestId('miniapp-install-screen')).toBeVisible(); | ||
|
|
||
| await screen.getByTestId('miniapp-install-button').tap(); | ||
| await expect(screen.getByTestId('miniapp-install-content')).toBeVisible(); | ||
|
|
||
| await screen.getByTestId('miniapp-clear-cache-button').tap(); | ||
| await expect(screen.getByTestId('miniapp-install-content')).toBeHidden(); | ||
| await expect(screen.getByTestId('miniapp-install-button')).toBeEnabled(); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import { test } from '@e2e-dev/mobile'; | ||
| import { expect } from 'e2e'; | ||
|
|
||
| test('NativeWind styles render, respond and switch to dark', async ({ | ||
| app, | ||
| screen, | ||
| }) => { | ||
| await app.open(); | ||
| await expect(screen.getByTestId('home-screen')).toBeVisible({ | ||
| timeout: 30_000, | ||
| }); | ||
|
|
||
| const entry = screen.getByTestId('home-nativewind-button'); | ||
| await screen.scrollUntilVisible(entry); | ||
| await entry.tap(); | ||
| await expect(screen.getByTestId('nativewind-screen')).toBeVisible(); | ||
|
|
||
| const padding = screen.getByTestId('nativewind-padding-report'); | ||
| await expect(padding).toHaveText('padding-applied: 16'); | ||
|
|
||
| const calcWidth = screen.getByTestId('nativewind-calc-width-report'); | ||
| await expect(calcWidth).toHaveText('calc-width: 248'); | ||
|
|
||
| const colorScheme = screen.getByTestId('nativewind-color-scheme-report'); | ||
| await expect(colorScheme).toHaveText('color-scheme: light'); | ||
| await screen.getByTestId('nativewind-dark-mode-button').tap(); | ||
| await expect(colorScheme).toHaveText('color-scheme: dark'); | ||
| await screen.getByTestId('nativewind-dark-mode-button').tap(); | ||
| await expect(colorScheme).toHaveText('color-scheme: light'); | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import { test } from '@e2e-dev/mobile'; | ||
| import { expect } from 'e2e'; | ||
|
|
||
| test('Reanimated spring tracks taps and reset', async ({ app, screen }) => { | ||
| await app.open(); | ||
| await expect(screen.getByTestId('home-screen')).toBeVisible({ | ||
| timeout: 30_000, | ||
| }); | ||
|
|
||
| const entry = screen.getByTestId('home-reanimated-button'); | ||
| await screen.scrollUntilVisible(entry); | ||
| await entry.tap(); | ||
| await expect(screen.getByTestId('reanimated-screen')).toBeVisible(); | ||
|
|
||
| const width = screen.getByTestId('reanimated-width-report'); | ||
| await expect(width).toHaveText('width: 100'); | ||
|
|
||
| await screen.getByTestId('reanimated-click-button').tap(); | ||
| await expect(width).toHaveText('width: 150'); | ||
|
|
||
| await screen.getByTestId('reanimated-click-button').tap(); | ||
| await expect(width).toHaveText('width: 200'); | ||
|
|
||
| await screen.getByTestId('reanimated-reset-button').tap(); | ||
| await expect(width).toHaveText('width: 100'); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import { test } from '@e2e-dev/mobile'; | ||
| import { expect } from 'e2e'; | ||
|
|
||
| test('prefetch, load, and invalidate the host remote chunk', async ({ | ||
| app, | ||
| screen, | ||
| }) => { | ||
| await app.open(); | ||
| await expect(screen.getByTestId('home-screen')).toBeVisible({ | ||
| timeout: 30_000, | ||
| }); | ||
|
|
||
| const entry = screen.getByTestId('home-remote-chunk-button'); | ||
| await screen.scrollUntilVisible(entry); | ||
| await entry.tap(); | ||
| await expect(screen.getByTestId('remote-chunk-screen')).toBeVisible(); | ||
|
|
||
| await screen.getByTestId('remote-chunk-prefetch-button').tap(); | ||
| await expect( | ||
| screen.getByTestId('remote-chunk-prefetch-button') | ||
| ).toBeDisabled(); | ||
|
|
||
| await screen.getByTestId('remote-chunk-load-button').tap(); | ||
| await expect(screen.getByTestId('remote-chunk-content')).toBeVisible(); | ||
|
|
||
| await screen.getByTestId('remote-chunk-clear-cache-button').tap(); | ||
| await expect(screen.getByTestId('remote-chunk-content')).toBeHidden(); | ||
| await expect(screen.getByTestId('remote-chunk-load-button')).toBeVisible(); | ||
| await expect( | ||
| screen.getByTestId('remote-chunk-prefetch-button') | ||
| ).toBeEnabled(); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.