ci(flutter): verify Windows builds on Forgejo #34
6 changed files with 251 additions and 101 deletions
62
.forgejo/workflows/flutter-windows.yml
Normal file
62
.forgejo/workflows/flutter-windows.yml
Normal file
|
|
@ -0,0 +1,62 @@
|
||||||
|
name: Flutter Windows
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- ".forgejo/workflows/flutter-windows.yml"
|
||||||
|
- "hesabixUI/hesabix_ui/**"
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
paths:
|
||||||
|
- ".forgejo/workflows/flutter-windows.yml"
|
||||||
|
- "hesabixUI/hesabix_ui/**"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: flutter-windows-${{ forgejo.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
verify-windows:
|
||||||
|
# The Forgejo repository must have an online Windows runner with this label.
|
||||||
|
runs-on: windows-latest
|
||||||
|
timeout-minutes: 45
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: hesabixUI/hesabix_ui
|
||||||
|
shell: pwsh
|
||||||
|
steps:
|
||||||
|
- name: Check out source
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Flutter
|
||||||
|
uses: subosito/flutter-action@v2.23.0
|
||||||
|
with:
|
||||||
|
channel: stable
|
||||||
|
flutter-version: 3.47.2
|
||||||
|
|
||||||
|
- name: Resolve locked dependencies
|
||||||
|
run: flutter pub get
|
||||||
|
|
||||||
|
- name: Apply verified flutter_sound Windows patch
|
||||||
|
run: ./scripts/patch_flutter_sound_windows.ps1 -ProjectRoot $PWD.Path
|
||||||
|
|
||||||
|
- name: Analyze Dart sources
|
||||||
|
run: flutter analyze
|
||||||
|
|
||||||
|
- name: Run Flutter tests
|
||||||
|
run: flutter test
|
||||||
|
|
||||||
|
- name: Build Windows release bundle
|
||||||
|
run: flutter build windows --release --dart-define=API_BASE_URL=https://hsxn.hesabix.ir
|
||||||
|
|
||||||
|
- name: Verify Windows bundle
|
||||||
|
run: |
|
||||||
|
$bundle = "build/windows/x64/runner/Release"
|
||||||
|
if (-not (Test-Path -LiteralPath $bundle -PathType Container)) {
|
||||||
|
throw "Windows release bundle was not produced at $bundle"
|
||||||
|
}
|
||||||
|
if (-not (Get-ChildItem -LiteralPath $bundle -Filter "*.exe" -File)) {
|
||||||
|
throw "Windows release bundle does not contain an executable"
|
||||||
|
}
|
||||||
|
|
@ -16,18 +16,25 @@ function Get-PackageRootFromConfig {
|
||||||
if (-not (Test-Path -LiteralPath $ConfigPath)) {
|
if (-not (Test-Path -LiteralPath $ConfigPath)) {
|
||||||
return $null
|
return $null
|
||||||
}
|
}
|
||||||
$raw = Get-Content -LiteralPath $ConfigPath -Raw -Encoding UTF8
|
$config = Get-Content -LiteralPath $ConfigPath -Raw -Encoding UTF8 | ConvertFrom-Json
|
||||||
$pattern = '"name"\s*:\s*"' + [regex]::Escape($PackageName) + '"\s*,\s*"rootUri"\s*:\s*"([^"]+)"'
|
$package = $config.packages | Where-Object { $_.name -eq $PackageName } | Select-Object -First 1
|
||||||
$m = [regex]::Match($raw, $pattern)
|
if (-not $package -or -not $package.rootUri) {
|
||||||
if (-not $m.Success) {
|
|
||||||
return $null
|
return $null
|
||||||
}
|
}
|
||||||
$uri = [System.Uri]$m.Groups[1].Value
|
|
||||||
$path = $uri.LocalPath
|
$rootUri = [string]$package.rootUri
|
||||||
if ($path.StartsWith('/')) {
|
if ([System.Uri]::IsWellFormedUriString($rootUri, [System.UriKind]::Absolute)) {
|
||||||
$path = $path.Substring(1)
|
$uri = [System.Uri]$rootUri
|
||||||
|
$path = [System.Uri]::UnescapeDataString($uri.LocalPath)
|
||||||
|
if ($path -match '^/[A-Za-z]:/') {
|
||||||
|
$path = $path.Substring(1)
|
||||||
|
}
|
||||||
|
return $path
|
||||||
}
|
}
|
||||||
return $path
|
|
||||||
|
return [System.IO.Path]::GetFullPath(
|
||||||
|
(Join-Path (Split-Path -Parent $ConfigPath) $rootUri)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function Apply-FlutterSoundWindowsPatch {
|
function Apply-FlutterSoundWindowsPatch {
|
||||||
|
|
@ -39,12 +46,34 @@ function Apply-FlutterSoundWindowsPatch {
|
||||||
$cmakePatch = Join-Path $patchRoot "CMakeLists.txt"
|
$cmakePatch = Join-Path $patchRoot "CMakeLists.txt"
|
||||||
$headerPatch = Join-Path $patchRoot "include\flutter_sound\flutter_sound_plugin_c_api.h"
|
$headerPatch = Join-Path $patchRoot "include\flutter_sound\flutter_sound_plugin_c_api.h"
|
||||||
|
|
||||||
|
foreach ($patchFile in @($cmakePatch, $headerPatch)) {
|
||||||
|
if (-not (Test-Path -LiteralPath $patchFile -PathType Leaf)) {
|
||||||
|
throw "Required flutter_sound patch file is missing: $patchFile"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$destWindows = Join-Path $PackageRoot "windows"
|
$destWindows = Join-Path $PackageRoot "windows"
|
||||||
if (-not (Test-Path -LiteralPath $destWindows)) {
|
if (-not (Test-Path -LiteralPath $destWindows)) {
|
||||||
throw "flutter_sound has no windows/ folder at: $destWindows"
|
throw "flutter_sound has no windows/ folder at: $destWindows"
|
||||||
}
|
}
|
||||||
|
|
||||||
Copy-Item -LiteralPath $cmakePatch -Destination (Join-Path $destWindows "CMakeLists.txt") -Force
|
$destCmake = Join-Path $destWindows "CMakeLists.txt"
|
||||||
|
if (-not (Test-Path -LiteralPath $destCmake -PathType Leaf)) {
|
||||||
|
throw "flutter_sound CMakeLists.txt is missing: $destCmake"
|
||||||
|
}
|
||||||
|
|
||||||
|
$patchHash = (Get-FileHash -LiteralPath $cmakePatch -Algorithm SHA256).Hash
|
||||||
|
$destinationHash = (Get-FileHash -LiteralPath $destCmake -Algorithm SHA256).Hash
|
||||||
|
if ($patchHash -ne $destinationHash) {
|
||||||
|
$destinationText = Get-Content -LiteralPath $destCmake -Raw -Encoding UTF8
|
||||||
|
$knownUpstreamLayout =
|
||||||
|
$destinationText -match 'set\(PLUGIN_NAME\s+"taudio_plugin"\)' -and
|
||||||
|
$destinationText -match 'set\(taudio_bundled_libraries'
|
||||||
|
if (-not $knownUpstreamLayout) {
|
||||||
|
throw "Unsupported flutter_sound Windows CMake layout; refusing to overwrite $destCmake"
|
||||||
|
}
|
||||||
|
Copy-Item -LiteralPath $cmakePatch -Destination $destCmake -Force
|
||||||
|
}
|
||||||
|
|
||||||
$destHeaderDir = Join-Path $destWindows "include\flutter_sound"
|
$destHeaderDir = Join-Path $destWindows "include\flutter_sound"
|
||||||
New-Item -ItemType Directory -Path $destHeaderDir -Force | Out-Null
|
New-Item -ItemType Directory -Path $destHeaderDir -Force | Out-Null
|
||||||
|
|
@ -72,13 +101,16 @@ if (-not $packageRoot -or -not (Test-Path -LiteralPath $packageRoot)) {
|
||||||
$lockPath = Join-Path $ProjectRoot "pubspec.lock"
|
$lockPath = Join-Path $ProjectRoot "pubspec.lock"
|
||||||
$lockText = if (Test-Path -LiteralPath $lockPath) { Get-Content -LiteralPath $lockPath -Raw } else { "" }
|
$lockText = if (Test-Path -LiteralPath $lockPath) { Get-Content -LiteralPath $lockPath -Raw } else { "" }
|
||||||
if ($lockText -notmatch '(?s)flutter_sound:.*?version:\s*"([^"]+)"') {
|
if ($lockText -notmatch '(?s)flutter_sound:.*?version:\s*"([^"]+)"') {
|
||||||
Write-Host "[warn] Could not read flutter_sound version from pubspec.lock; applying patch anyway." -ForegroundColor Yellow
|
throw "Could not read flutter_sound version from pubspec.lock; refusing an unverified patch."
|
||||||
} else {
|
} else {
|
||||||
$ver = $Matches[1]
|
$ver = $Matches[1]
|
||||||
if ([version]$ver -lt [version]"9.29.0") {
|
if ([version]$ver -lt [version]"9.29.0") {
|
||||||
Write-Host "[info] flutter_sound $ver (< 9.29): Windows desktop plugin patch not required." -ForegroundColor DarkGray
|
Write-Host "[info] flutter_sound $ver (< 9.29): Windows desktop plugin patch not required." -ForegroundColor DarkGray
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
if ([version]$ver -ge [version]"10.0.0") {
|
||||||
|
throw "flutter_sound $ver is outside the verified patch range (>=9.29.0,<10.0.0)."
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Apply-FlutterSoundWindowsPatch -PackageRoot $packageRoot
|
Apply-FlutterSoundWindowsPatch -PackageRoot $packageRoot
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,10 @@ void main() {
|
||||||
TestWidgetsFlutterBinding.ensureInitialized();
|
TestWidgetsFlutterBinding.ensureInitialized();
|
||||||
|
|
||||||
group('Column Settings Isolation Tests', () {
|
group('Column Settings Isolation Tests', () {
|
||||||
|
setUp(() {
|
||||||
|
SharedPreferences.setMockInitialValues({});
|
||||||
|
});
|
||||||
|
|
||||||
test('should have different settings for different tables', () async {
|
test('should have different settings for different tables', () async {
|
||||||
// Clear any existing settings
|
// Clear any existing settings
|
||||||
await ColumnSettingsService.clearColumnSettings('table1');
|
await ColumnSettingsService.clearColumnSettings('table1');
|
||||||
|
|
@ -30,8 +34,12 @@ void main() {
|
||||||
await ColumnSettingsService.saveColumnSettings('table2', settings2);
|
await ColumnSettingsService.saveColumnSettings('table2', settings2);
|
||||||
|
|
||||||
// Retrieve settings
|
// Retrieve settings
|
||||||
final retrieved1 = await ColumnSettingsService.getColumnSettings('table1');
|
final retrieved1 = await ColumnSettingsService.getColumnSettings(
|
||||||
final retrieved2 = await ColumnSettingsService.getColumnSettings('table2');
|
'table1',
|
||||||
|
);
|
||||||
|
final retrieved2 = await ColumnSettingsService.getColumnSettings(
|
||||||
|
'table2',
|
||||||
|
);
|
||||||
|
|
||||||
// Verify they are different
|
// Verify they are different
|
||||||
expect(retrieved1, isNotNull);
|
expect(retrieved1, isNotNull);
|
||||||
|
|
@ -41,7 +49,10 @@ void main() {
|
||||||
expect(retrieved1.columnOrder, equals(['name', 'id']));
|
expect(retrieved1.columnOrder, equals(['name', 'id']));
|
||||||
expect(retrieved2.columnOrder, equals(['id', 'createdAt', 'email']));
|
expect(retrieved2.columnOrder, equals(['id', 'createdAt', 'email']));
|
||||||
expect(retrieved1.columnWidths, equals({'name': 200.0}));
|
expect(retrieved1.columnWidths, equals({'name': 200.0}));
|
||||||
expect(retrieved2.columnWidths, equals({'email': 300.0, 'createdAt': 150.0}));
|
expect(
|
||||||
|
retrieved2.columnWidths,
|
||||||
|
equals({'email': 300.0, 'createdAt': 150.0}),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should generate unique table IDs from endpoints', () {
|
test('should generate unique table IDs from endpoints', () {
|
||||||
|
|
@ -124,7 +135,9 @@ void main() {
|
||||||
expect(prefs.getString('theme_settings'), equals('dark_mode'));
|
expect(prefs.getString('theme_settings'), equals('dark_mode'));
|
||||||
|
|
||||||
// Verify column settings are saved
|
// Verify column settings are saved
|
||||||
final retrieved = await ColumnSettingsService.getColumnSettings('test_table');
|
final retrieved = await ColumnSettingsService.getColumnSettings(
|
||||||
|
'test_table',
|
||||||
|
);
|
||||||
expect(retrieved, isNotNull);
|
expect(retrieved, isNotNull);
|
||||||
expect(retrieved!.visibleColumns, equals(['id', 'name']));
|
expect(retrieved!.visibleColumns, equals(['id', 'name']));
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ void main() {
|
||||||
expect(settings.columnWidths, isEmpty);
|
expect(settings.columnWidths, isEmpty);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should merge user settings with defaults correctly', () {
|
test('should expose newly available default columns', () {
|
||||||
final defaultKeys = ['id', 'name', 'email', 'createdAt', 'updatedAt'];
|
final defaultKeys = ['id', 'name', 'email', 'createdAt', 'updatedAt'];
|
||||||
final userSettings = ColumnSettings(
|
final userSettings = ColumnSettings(
|
||||||
visibleColumns: ['id', 'name', 'email'],
|
visibleColumns: ['id', 'name', 'email'],
|
||||||
|
|
@ -20,10 +20,19 @@ void main() {
|
||||||
columnWidths: {'name': 200.0},
|
columnWidths: {'name': 200.0},
|
||||||
);
|
);
|
||||||
|
|
||||||
final merged = ColumnSettingsService.mergeWithDefaults(userSettings, defaultKeys);
|
final merged = ColumnSettingsService.mergeWithDefaults(
|
||||||
|
userSettings,
|
||||||
|
defaultKeys,
|
||||||
|
);
|
||||||
|
|
||||||
expect(merged.visibleColumns, equals(['id', 'name', 'email']));
|
expect(
|
||||||
expect(merged.columnOrder, equals(['name', 'id', 'email']));
|
merged.visibleColumns,
|
||||||
|
equals(['id', 'name', 'email', 'createdAt', 'updatedAt']),
|
||||||
|
);
|
||||||
|
expect(
|
||||||
|
merged.columnOrder,
|
||||||
|
equals(['name', 'id', 'email', 'createdAt', 'updatedAt']),
|
||||||
|
);
|
||||||
expect(merged.columnWidths, equals({'name': 200.0}));
|
expect(merged.columnWidths, equals({'name': 200.0}));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -44,7 +53,10 @@ void main() {
|
||||||
columnWidths: {'name': 200.0, 'invalidColumn': 150.0},
|
columnWidths: {'name': 200.0, 'invalidColumn': 150.0},
|
||||||
);
|
);
|
||||||
|
|
||||||
final merged = ColumnSettingsService.mergeWithDefaults(userSettings, defaultKeys);
|
final merged = ColumnSettingsService.mergeWithDefaults(
|
||||||
|
userSettings,
|
||||||
|
defaultKeys,
|
||||||
|
);
|
||||||
|
|
||||||
expect(merged.visibleColumns, equals(['id', 'name', 'email']));
|
expect(merged.visibleColumns, equals(['id', 'name', 'email']));
|
||||||
expect(merged.columnOrder, equals(['name', 'id', 'email']));
|
expect(merged.columnOrder, equals(['name', 'id', 'email']));
|
||||||
|
|
|
||||||
|
|
@ -11,28 +11,43 @@ void main() {
|
||||||
columnWidths: {},
|
columnWidths: {},
|
||||||
);
|
);
|
||||||
|
|
||||||
final merged = ColumnSettingsService.mergeWithDefaults(userSettings, defaultKeys);
|
final merged = ColumnSettingsService.mergeWithDefaults(
|
||||||
|
userSettings,
|
||||||
|
defaultKeys,
|
||||||
|
);
|
||||||
|
|
||||||
// Should have at least one column visible
|
// Should have at least one column visible
|
||||||
expect(merged.visibleColumns, isNotEmpty);
|
expect(merged.visibleColumns, isNotEmpty);
|
||||||
expect(merged.visibleColumns.length, greaterThanOrEqualTo(1));
|
expect(merged.visibleColumns.length, greaterThanOrEqualTo(1));
|
||||||
expect(merged.visibleColumns.first, equals('id')); // First column should be visible
|
expect(
|
||||||
|
merged.visibleColumns.first,
|
||||||
|
equals('id'),
|
||||||
|
); // First column should be visible
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should preserve existing visible columns', () {
|
test(
|
||||||
final defaultKeys = ['id', 'name', 'email', 'createdAt'];
|
'should preserve existing columns and expose newly available columns',
|
||||||
final userSettings = ColumnSettings(
|
() {
|
||||||
visibleColumns: ['name', 'email'], // Some columns visible
|
final defaultKeys = ['id', 'name', 'email', 'createdAt'];
|
||||||
columnOrder: ['name', 'email'],
|
final userSettings = ColumnSettings(
|
||||||
columnWidths: {'name': 200.0},
|
visibleColumns: ['name', 'email'], // Some columns visible
|
||||||
);
|
columnOrder: ['name', 'email'],
|
||||||
|
columnWidths: {'name': 200.0},
|
||||||
|
);
|
||||||
|
|
||||||
final merged = ColumnSettingsService.mergeWithDefaults(userSettings, defaultKeys);
|
final merged = ColumnSettingsService.mergeWithDefaults(
|
||||||
|
userSettings,
|
||||||
|
defaultKeys,
|
||||||
|
);
|
||||||
|
|
||||||
expect(merged.visibleColumns, equals(['name', 'email']));
|
expect(merged.visibleColumns, equals(defaultKeys));
|
||||||
expect(merged.columnOrder, equals(['name', 'email']));
|
expect(
|
||||||
expect(merged.columnWidths, equals({'name': 200.0}));
|
merged.columnOrder,
|
||||||
});
|
equals(['name', 'email', 'id', 'createdAt']),
|
||||||
|
);
|
||||||
|
expect(merged.columnWidths, equals({'name': 200.0}));
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
test('should handle empty default keys gracefully', () {
|
test('should handle empty default keys gracefully', () {
|
||||||
final defaultKeys = <String>[];
|
final defaultKeys = <String>[];
|
||||||
|
|
@ -42,7 +57,10 @@ void main() {
|
||||||
columnWidths: {},
|
columnWidths: {},
|
||||||
);
|
);
|
||||||
|
|
||||||
final merged = ColumnSettingsService.mergeWithDefaults(userSettings, defaultKeys);
|
final merged = ColumnSettingsService.mergeWithDefaults(
|
||||||
|
userSettings,
|
||||||
|
defaultKeys,
|
||||||
|
);
|
||||||
|
|
||||||
// Should return empty settings when no default keys
|
// Should return empty settings when no default keys
|
||||||
expect(merged.visibleColumns, isEmpty);
|
expect(merged.visibleColumns, isEmpty);
|
||||||
|
|
@ -58,29 +76,36 @@ void main() {
|
||||||
columnWidths: {'invalid1': 200.0, 'name': 150.0},
|
columnWidths: {'invalid1': 200.0, 'name': 150.0},
|
||||||
);
|
);
|
||||||
|
|
||||||
final merged = ColumnSettingsService.mergeWithDefaults(userSettings, defaultKeys);
|
final merged = ColumnSettingsService.mergeWithDefaults(
|
||||||
|
userSettings,
|
||||||
|
defaultKeys,
|
||||||
|
);
|
||||||
|
|
||||||
// Should have at least one valid column visible
|
// Invalid saved columns are discarded; newly available defaults are shown.
|
||||||
expect(merged.visibleColumns, isNotEmpty);
|
expect(merged.visibleColumns, equals(defaultKeys));
|
||||||
expect(merged.visibleColumns.length, greaterThanOrEqualTo(1));
|
expect(merged.columnOrder, equals(defaultKeys));
|
||||||
expect(merged.visibleColumns.first, equals('id')); // First valid column
|
expect(merged.columnWidths, equals({'name': 150.0}));
|
||||||
|
|
||||||
// Should filter out invalid column widths (name is not in visible columns)
|
|
||||||
expect(merged.columnWidths, isEmpty);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should maintain column order when adding missing columns', () {
|
test('should maintain column order when adding missing columns', () {
|
||||||
final defaultKeys = ['id', 'name', 'email', 'createdAt'];
|
final defaultKeys = ['id', 'name', 'email', 'createdAt'];
|
||||||
final userSettings = ColumnSettings(
|
final userSettings = ColumnSettings(
|
||||||
visibleColumns: ['name', 'email'],
|
visibleColumns: ['name', 'email'],
|
||||||
columnOrder: ['name', 'email', 'id'], // 'id' is not in visible but in order
|
columnOrder: [
|
||||||
|
'name',
|
||||||
|
'email',
|
||||||
|
'id',
|
||||||
|
], // 'id' is not in visible but in order
|
||||||
columnWidths: {},
|
columnWidths: {},
|
||||||
);
|
);
|
||||||
|
|
||||||
final merged = ColumnSettingsService.mergeWithDefaults(userSettings, defaultKeys);
|
final merged = ColumnSettingsService.mergeWithDefaults(
|
||||||
|
userSettings,
|
||||||
|
defaultKeys,
|
||||||
|
);
|
||||||
|
|
||||||
expect(merged.visibleColumns, equals(['name', 'email']));
|
expect(merged.visibleColumns, equals(defaultKeys));
|
||||||
expect(merged.columnOrder, equals(['name', 'email'])); // Should filter out 'id'
|
expect(merged.columnOrder, equals(['name', 'email', 'id', 'createdAt']));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,24 +7,30 @@
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
import 'package:hesabix_ui/l10n/app_localizations.dart';
|
||||||
import 'package:hesabix_ui/main.dart';
|
import 'package:hesabix_ui/widgets/progress_splash_screen.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
|
testWidgets(
|
||||||
// Build our app and trigger a frame.
|
'progress splash renders without starting network initialization',
|
||||||
await tester.pumpWidget(const MyApp());
|
(WidgetTester tester) async {
|
||||||
|
await tester.pumpWidget(
|
||||||
|
const MaterialApp(
|
||||||
|
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||||
|
supportedLocales: AppLocalizations.supportedLocales,
|
||||||
|
home: ProgressSplashScreen(
|
||||||
|
message: 'Loading',
|
||||||
|
progress: 0.5,
|
||||||
|
currentStep: 2,
|
||||||
|
totalSteps: 4,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
|
||||||
// Verify that our counter starts at 0.
|
expect(find.byType(MaterialApp), findsOneWidget);
|
||||||
expect(find.text('0'), findsOneWidget);
|
expect(find.byType(ProgressSplashScreen), findsOneWidget);
|
||||||
expect(find.text('1'), findsNothing);
|
expect(find.text('Loading'), findsOneWidget);
|
||||||
|
},
|
||||||
// Tap the '+' icon and trigger a frame.
|
);
|
||||||
await tester.tap(find.byIcon(Icons.add));
|
|
||||||
await tester.pump();
|
|
||||||
|
|
||||||
// Verify that our counter has incremented.
|
|
||||||
expect(find.text('0'), findsNothing);
|
|
||||||
expect(find.text('1'), findsOneWidget);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue