splashRoleAppTest function
The test of the splash role that the CLI keeps in its
app_tests/splash_role, for the apps with the role, whichever module
provides it: the two images of the role are in the app, and the step of
the provider made the screen in the native projects. Below Android 12, the
window background of the activity has an image in each mode and at each
version of the system. From Android 12 on, the theme of the activity names
a background and an icon of the splash screen of the system in each mode.
On iOS, the launch storyboard shows an image for the dark mode too, whose
files are larger than the image of one pixel of a new project and in the
ratio of their scales.
The test reads the files of the app as smf create left them. It follows
what the system follows and names no tool, so a provider without any
package gets it too. The paths come from the roles. It has no mocks and no
probe for the start check: nothing of the screen shows in Dart, and a
launch from a command hides the icon of the splash screen of Android 12.
The fixtures have no provider of the role: the real module shows the bug
that the test catches (brokenProviders of the fixture registry).
Implementation
Future<MatrixAppTest> splashRoleAppTest() async => MatrixAppTest(
'${await appTestsDirectoryOf('smf_flutter_cli')}/splash_role',
appliesTo: (app) => app.hook!.presentRoles.contains(splashRole),
devDependencies: const ['xml'],
values: (app) => const {
'light_image': SplashRole.lightImageFile,
'dark_image': SplashRole.darkImageFile,
'android_manifest': AppEntryRole.androidManifestFile,
'info_plist': AppEntryRole.infoPlistFile,
},
roles: {splashRole},
);