chore: bump line length to 120 (#20191)
This commit is contained in:
@@ -198,8 +198,7 @@ void main() {
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
when(() => activityMock.addComment(any()))
|
||||
.thenAnswer((_) => Future.value());
|
||||
when(() => activityMock.addComment(any())).thenAnswer((_) => Future.value());
|
||||
|
||||
final textField = find.byType(TextField);
|
||||
await tester.enterText(textField, 'Test comment');
|
||||
|
||||
@@ -6,9 +6,7 @@ import 'package:mocktail/mocktail.dart';
|
||||
|
||||
class ActivityServiceMock extends Mock implements ActivityService {}
|
||||
|
||||
class MockAlbumActivity extends AlbumActivityInternal
|
||||
with Mock
|
||||
implements AlbumActivity {
|
||||
class MockAlbumActivity extends AlbumActivityInternal with Mock implements AlbumActivity {
|
||||
List<Activity>? initActivities;
|
||||
MockAlbumActivity([this.initActivities]);
|
||||
|
||||
@@ -18,6 +16,4 @@ class MockAlbumActivity extends AlbumActivityInternal
|
||||
}
|
||||
}
|
||||
|
||||
class ActivityStatisticsMock extends ActivityStatisticsInternal
|
||||
with Mock
|
||||
implements ActivityStatistics {}
|
||||
class ActivityStatisticsMock extends ActivityStatisticsInternal with Mock implements ActivityStatistics {}
|
||||
|
||||
@@ -58,8 +58,7 @@ void main() {
|
||||
container = TestUtils.createContainer(
|
||||
overrides: [
|
||||
activityServiceProvider.overrideWith((ref) => activityMock),
|
||||
activityStatisticsProvider('test-album', 'test-asset')
|
||||
.overrideWith(() => activityStatisticsMock),
|
||||
activityStatisticsProvider('test-album', 'test-asset').overrideWith(() => activityStatisticsMock),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -90,8 +89,7 @@ void main() {
|
||||
[
|
||||
isA<AsyncData<List<Activity>>>(),
|
||||
predicate(
|
||||
(AsyncData<List<Activity>> ad) =>
|
||||
ad.requireValue.every((e) => _activities.contains(e)),
|
||||
(AsyncData<List<Activity>> ad) => ad.requireValue.every((e) => _activities.contains(e)),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -172,8 +170,7 @@ void main() {
|
||||
|
||||
group('removeActivity()', () {
|
||||
test('Like successfully removed', () async {
|
||||
when(() => activityMock.removeActivity('3'))
|
||||
.thenAnswer((_) async => true);
|
||||
when(() => activityMock.removeActivity('3')).thenAnswer((_) async => true);
|
||||
|
||||
await container.read(provider.notifier).removeActivity('3');
|
||||
|
||||
@@ -192,8 +189,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('Remove Like failed', () async {
|
||||
when(() => activityMock.removeActivity('3'))
|
||||
.thenAnswer((_) async => false);
|
||||
when(() => activityMock.removeActivity('3')).thenAnswer((_) async => false);
|
||||
|
||||
await container.read(provider.notifier).removeActivity('3');
|
||||
|
||||
@@ -206,8 +202,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('Comment successfully removed', () async {
|
||||
when(() => activityMock.removeActivity('1'))
|
||||
.thenAnswer((_) async => true);
|
||||
when(() => activityMock.removeActivity('1')).thenAnswer((_) async => true);
|
||||
|
||||
await container.read(provider.notifier).removeActivity('1');
|
||||
|
||||
@@ -229,10 +224,8 @@ void main() {
|
||||
container = TestUtils.createContainer(
|
||||
overrides: [
|
||||
activityServiceProvider.overrideWith((ref) => activityMock),
|
||||
activityStatisticsProvider('test-album', 'test-asset')
|
||||
.overrideWith(() => activityStatisticsMock),
|
||||
activityStatisticsProvider('test-album')
|
||||
.overrideWith(() => albumActivityStatisticsMock),
|
||||
activityStatisticsProvider('test-album', 'test-asset').overrideWith(() => activityStatisticsMock),
|
||||
activityStatisticsProvider('test-album').overrideWith(() => albumActivityStatisticsMock),
|
||||
],
|
||||
);
|
||||
});
|
||||
@@ -255,8 +248,7 @@ void main() {
|
||||
comment: 'Test-Comment',
|
||||
),
|
||||
).thenAnswer((_) async => AsyncData(comment));
|
||||
when(() => activityStatisticsMock.build('test-album', 'test-asset'))
|
||||
.thenReturn(4);
|
||||
when(() => activityStatisticsMock.build('test-album', 'test-asset')).thenReturn(4);
|
||||
when(() => albumActivityStatisticsMock.build('test-album')).thenReturn(2);
|
||||
|
||||
await container.read(provider.notifier).addComment('Test-Comment');
|
||||
@@ -296,8 +288,7 @@ void main() {
|
||||
),
|
||||
).thenAnswer((_) async => AsyncData(comment));
|
||||
when(() => albumActivityStatisticsMock.build('test-album')).thenReturn(2);
|
||||
when(() => activityMock.getAllActivities('test-album'))
|
||||
.thenAnswer((_) async => [..._activities]);
|
||||
when(() => activityMock.getAllActivities('test-album')).thenAnswer((_) async => [..._activities]);
|
||||
|
||||
final albumProvider = albumActivityProvider('test-album');
|
||||
await container.read(albumProvider.notifier).addComment('Test-Comment');
|
||||
|
||||
@@ -44,8 +44,7 @@ void main() {
|
||||
activityMock = MockAlbumActivity();
|
||||
overrides = [
|
||||
currentAlbumProvider.overrideWith(() => mockCurrentAlbumProvider),
|
||||
albumActivityProvider(AlbumStub.twoAsset.remoteId!)
|
||||
.overrideWith(() => activityMock),
|
||||
albumActivityProvider(AlbumStub.twoAsset.remoteId!).overrideWith(() => activityMock),
|
||||
];
|
||||
});
|
||||
|
||||
@@ -152,8 +151,7 @@ void main() {
|
||||
overrides: overrides,
|
||||
);
|
||||
|
||||
when(() => activityMock.removeActivity(any()))
|
||||
.thenAnswer((_) => Future.value());
|
||||
when(() => activityMock.removeActivity(any())).thenAnswer((_) => Future.value());
|
||||
|
||||
final suffixIcon = find.byType(IconButton);
|
||||
await tester.tap(suffixIcon);
|
||||
|
||||
@@ -57,8 +57,7 @@ void main() {
|
||||
expect(find.byType(ListTile), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('No trailing widget when activity assetId == null',
|
||||
(tester) async {
|
||||
testWidgets('No trailing widget when activity assetId == null', (tester) async {
|
||||
await tester.pumpConsumerWidget(
|
||||
ActivityTile(
|
||||
Activity(
|
||||
@@ -75,9 +74,7 @@ void main() {
|
||||
expect(listTile.trailing, isNull);
|
||||
});
|
||||
|
||||
testWidgets(
|
||||
'Asset Thumbanil as trailing widget when activity assetId != null',
|
||||
(tester) async {
|
||||
testWidgets('Asset Thumbanil as trailing widget when activity assetId != null', (tester) async {
|
||||
await tester.pumpConsumerWidget(
|
||||
ActivityTile(
|
||||
Activity(
|
||||
@@ -176,8 +173,7 @@ void main() {
|
||||
user: UserStub.admin,
|
||||
);
|
||||
|
||||
testWidgets('Comment contains User Circle Avatar as leading',
|
||||
(tester) async {
|
||||
testWidgets('Comment contains User Circle Avatar as leading', (tester) async {
|
||||
await tester.pumpConsumerWidget(
|
||||
ActivityTile(activity),
|
||||
overrides: overrides,
|
||||
|
||||
@@ -55,9 +55,7 @@ void main() {
|
||||
expect(find.byType(ConfirmDialog), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets(
|
||||
'Ok action in ConfirmDialog should call onDismiss with activityId',
|
||||
(tester) async {
|
||||
testWidgets('Ok action in ConfirmDialog should call onDismiss with activityId', (tester) async {
|
||||
String? receivedActivityId;
|
||||
await tester.pumpConsumerWidget(
|
||||
DismissibleActivity(
|
||||
|
||||
@@ -2,9 +2,7 @@ import 'package:immich_mobile/providers/album/current_album.provider.dart';
|
||||
import 'package:immich_mobile/entities/album.entity.dart';
|
||||
import 'package:mocktail/mocktail.dart';
|
||||
|
||||
class MockCurrentAlbumProvider extends CurrentAlbum
|
||||
with Mock
|
||||
implements CurrentAlbumInternal {
|
||||
class MockCurrentAlbumProvider extends CurrentAlbum with Mock implements CurrentAlbumInternal {
|
||||
Album? initAlbum;
|
||||
MockCurrentAlbumProvider([this.initAlbum]);
|
||||
|
||||
|
||||
@@ -261,9 +261,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('Properly saves the correct store index of sort mode', () {
|
||||
container
|
||||
.read(albumSortByOptionsProvider.notifier)
|
||||
.changeSortMode(AlbumSortMode.mostOldest);
|
||||
container.read(albumSortByOptionsProvider.notifier).changeSortMode(AlbumSortMode.mostOldest);
|
||||
|
||||
verify(
|
||||
() => settingsMock.setSetting(
|
||||
@@ -286,14 +284,10 @@ void main() {
|
||||
);
|
||||
|
||||
// Created -> Most Oldest
|
||||
container
|
||||
.read(albumSortByOptionsProvider.notifier)
|
||||
.changeSortMode(AlbumSortMode.mostOldest);
|
||||
container.read(albumSortByOptionsProvider.notifier).changeSortMode(AlbumSortMode.mostOldest);
|
||||
|
||||
// Most Oldest -> Title
|
||||
container
|
||||
.read(albumSortByOptionsProvider.notifier)
|
||||
.changeSortMode(AlbumSortMode.title);
|
||||
container.read(albumSortByOptionsProvider.notifier).changeSortMode(AlbumSortMode.title);
|
||||
|
||||
verifyInOrder([
|
||||
() => listener.call(null, AlbumSortMode.created),
|
||||
@@ -368,9 +362,7 @@ void main() {
|
||||
container.read(albumSortOrderProvider.notifier).changeSortDirection(true);
|
||||
|
||||
// true -> false
|
||||
container
|
||||
.read(albumSortOrderProvider.notifier)
|
||||
.changeSortDirection(false);
|
||||
container.read(albumSortOrderProvider.notifier).changeSortDirection(false);
|
||||
|
||||
verifyInOrder([
|
||||
() => listener.call(null, false),
|
||||
|
||||
@@ -2,9 +2,7 @@ import 'package:immich_mobile/providers/asset_viewer/current_asset.provider.dart
|
||||
import 'package:immich_mobile/entities/asset.entity.dart';
|
||||
import 'package:mocktail/mocktail.dart';
|
||||
|
||||
class MockCurrentAssetProvider extends CurrentAssetInternal
|
||||
with Mock
|
||||
implements CurrentAsset {
|
||||
class MockCurrentAssetProvider extends CurrentAssetInternal with Mock implements CurrentAsset {
|
||||
Asset? initAsset;
|
||||
MockCurrentAssetProvider([this.initAsset]);
|
||||
|
||||
|
||||
@@ -76,8 +76,7 @@ void main() {
|
||||
expect(dateTimeInUTC.timeZoneOffset, tz);
|
||||
});
|
||||
|
||||
test('Returns dateTimeOriginal in UTC from exifInfo with invalid timezone',
|
||||
() {
|
||||
test('Returns dateTimeOriginal in UTC from exifInfo with invalid timezone', () {
|
||||
final createdAt = DateTime.parse("2023-01-27T14:00:00-0500");
|
||||
final dateTimeOriginal = DateTime.parse("2022-01-27T14:00:00+0530");
|
||||
final e = makeExif(
|
||||
@@ -98,13 +97,11 @@ void main() {
|
||||
final createdAt = DateTime.parse("2023-01-27T14:00:00-0500");
|
||||
final dateTimeOriginal = DateTime.parse("2022-01-27T14:00:00+0530");
|
||||
const location = "Asia/Hong_Kong";
|
||||
final e =
|
||||
makeExif(dateTimeOriginal: dateTimeOriginal, timeZone: location);
|
||||
final e = makeExif(dateTimeOriginal: dateTimeOriginal, timeZone: location);
|
||||
final a = makeAsset(id: '1', createdAt: createdAt, exifInfo: e);
|
||||
final (dt, tz) = a.getTZAdjustedTimeAndOffset();
|
||||
|
||||
final adjustedTime =
|
||||
TZDateTime.from(dateTimeOriginal.toUtc(), getLocation(location));
|
||||
final adjustedTime = TZDateTime.from(dateTimeOriginal.toUtc(), getLocation(location));
|
||||
expect(adjustedTime, dt);
|
||||
expect(adjustedTime.timeZoneOffset, tz);
|
||||
});
|
||||
@@ -118,8 +115,7 @@ void main() {
|
||||
final (dt, tz) = a.getTZAdjustedTimeAndOffset();
|
||||
|
||||
final location = getLocation("Asia/Hong_Kong");
|
||||
final offsetFromLocation =
|
||||
Duration(milliseconds: location.currentTimeZone.offset);
|
||||
final offsetFromLocation = Duration(milliseconds: location.currentTimeZone.offset);
|
||||
final adjustedTime = dateTimeOriginal.toUtc().add(offsetFromLocation);
|
||||
|
||||
// Adds the offset to the actual time and returns the offset separately
|
||||
|
||||
@@ -25,24 +25,21 @@ void main() {
|
||||
test('returns date range format for this year', () {
|
||||
final startDate = DateTime(currentYear, 3, 23); // Mar 23
|
||||
final endDate = DateTime(currentYear, 5, 31); // May 31
|
||||
final result =
|
||||
DateRangeFormatting.formatDateRange(startDate, endDate, null);
|
||||
final result = DateRangeFormatting.formatDateRange(startDate, endDate, null);
|
||||
expect(result, 'Mar 23 - May 31');
|
||||
});
|
||||
|
||||
test('returns date range format for other year (same year)', () {
|
||||
final startDate = DateTime(2023, 8, 28); // Aug 28
|
||||
final endDate = DateTime(2023, 9, 30); // Sep 30
|
||||
final result =
|
||||
DateRangeFormatting.formatDateRange(startDate, endDate, null);
|
||||
final result = DateRangeFormatting.formatDateRange(startDate, endDate, null);
|
||||
expect(result, 'Aug 28 - Sep 30, 2023');
|
||||
});
|
||||
|
||||
test('returns date range format over multiple years', () {
|
||||
final startDate = DateTime(2021, 4, 17); // Apr 17, 2021
|
||||
final endDate = DateTime(2022, 4, 9); // Apr 9, 2022
|
||||
final result =
|
||||
DateRangeFormatting.formatDateRange(startDate, endDate, null);
|
||||
final result = DateRangeFormatting.formatDateRange(startDate, endDate, null);
|
||||
expect(result, 'Apr 17, 2021 - Apr 9, 2022');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -3,9 +3,7 @@ import 'package:immich_mobile/models/map/map_state.model.dart';
|
||||
import 'package:immich_mobile/providers/map/map_state.provider.dart';
|
||||
import 'package:mocktail/mocktail.dart';
|
||||
|
||||
class MockMapStateNotifier extends Notifier<MapState>
|
||||
with Mock
|
||||
implements MapStateNotifier {
|
||||
class MockMapStateNotifier extends Notifier<MapState> with Mock implements MapStateNotifier {
|
||||
final MapState initState;
|
||||
|
||||
MockMapStateNotifier(this.initState);
|
||||
|
||||
@@ -38,8 +38,7 @@ void main() {
|
||||
];
|
||||
});
|
||||
|
||||
testWidgets("Return dark theme style when theme mode is dark",
|
||||
(tester) async {
|
||||
testWidgets("Return dark theme style when theme mode is dark", (tester) async {
|
||||
AsyncValue<String>? mapStyle;
|
||||
await tester.pumpConsumerWidget(
|
||||
MapThemeOverride(
|
||||
@@ -51,8 +50,7 @@ void main() {
|
||||
overrides: overrides,
|
||||
);
|
||||
|
||||
mapStateNotifier.state =
|
||||
mapState.copyWith(darkStyleFetched: const AsyncData("dark"));
|
||||
mapStateNotifier.state = mapState.copyWith(darkStyleFetched: const AsyncData("dark"));
|
||||
await tester.pumpAndSettle();
|
||||
expect(mapStyle?.valueOrNull, "dark");
|
||||
});
|
||||
@@ -76,8 +74,7 @@ void main() {
|
||||
expect(mapStyle?.hasError, isTrue);
|
||||
});
|
||||
|
||||
testWidgets("Return light theme style when theme mode is light",
|
||||
(tester) async {
|
||||
testWidgets("Return light theme style when theme mode is light", (tester) async {
|
||||
AsyncValue<String>? mapStyle;
|
||||
await tester.pumpConsumerWidget(
|
||||
MapThemeOverride(
|
||||
@@ -110,8 +107,7 @@ void main() {
|
||||
overrides: overrides,
|
||||
);
|
||||
|
||||
tester.binding.platformDispatcher.platformBrightnessTestValue =
|
||||
Brightness.dark;
|
||||
tester.binding.platformDispatcher.platformBrightnessTestValue = Brightness.dark;
|
||||
mapStateNotifier.state = mapState.copyWith(
|
||||
themeMode: ThemeMode.system,
|
||||
darkStyleFetched: const AsyncData("dark"),
|
||||
@@ -121,8 +117,7 @@ void main() {
|
||||
expect(mapStyle?.valueOrNull, "dark");
|
||||
});
|
||||
|
||||
testWidgets("Return light theme style when system is light",
|
||||
(tester) async {
|
||||
testWidgets("Return light theme style when system is light", (tester) async {
|
||||
AsyncValue<String>? mapStyle;
|
||||
await tester.pumpConsumerWidget(
|
||||
MapThemeOverride(
|
||||
@@ -134,8 +129,7 @@ void main() {
|
||||
overrides: overrides,
|
||||
);
|
||||
|
||||
tester.binding.platformDispatcher.platformBrightnessTestValue =
|
||||
Brightness.light;
|
||||
tester.binding.platformDispatcher.platformBrightnessTestValue = Brightness.light;
|
||||
mapStateNotifier.state = mapState.copyWith(
|
||||
themeMode: ThemeMode.system,
|
||||
lightStyleFetched: const AsyncData("light"),
|
||||
@@ -145,8 +139,7 @@ void main() {
|
||||
expect(mapStyle?.valueOrNull, "light");
|
||||
});
|
||||
|
||||
testWidgets("Switches style when system brightness changes",
|
||||
(tester) async {
|
||||
testWidgets("Switches style when system brightness changes", (tester) async {
|
||||
AsyncValue<String>? mapStyle;
|
||||
await tester.pumpConsumerWidget(
|
||||
MapThemeOverride(
|
||||
@@ -158,8 +151,7 @@ void main() {
|
||||
overrides: overrides,
|
||||
);
|
||||
|
||||
tester.binding.platformDispatcher.platformBrightnessTestValue =
|
||||
Brightness.light;
|
||||
tester.binding.platformDispatcher.platformBrightnessTestValue = Brightness.light;
|
||||
mapStateNotifier.state = mapState.copyWith(
|
||||
themeMode: ThemeMode.system,
|
||||
lightStyleFetched: const AsyncData("light"),
|
||||
@@ -168,8 +160,7 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
expect(mapStyle?.valueOrNull, "light");
|
||||
|
||||
tester.binding.platformDispatcher.platformBrightnessTestValue =
|
||||
Brightness.dark;
|
||||
tester.binding.platformDispatcher.platformBrightnessTestValue = Brightness.dark;
|
||||
await tester.pumpAndSettle();
|
||||
expect(mapStyle?.valueOrNull, "dark");
|
||||
});
|
||||
|
||||
@@ -3,9 +3,7 @@ import 'package:immich_mobile/domain/models/user.model.dart';
|
||||
import 'package:immich_mobile/providers/user.provider.dart';
|
||||
import 'package:mocktail/mocktail.dart';
|
||||
|
||||
class MockCurrentUserProvider extends StateNotifier<UserDto?>
|
||||
with Mock
|
||||
implements CurrentUserProvider {
|
||||
class MockCurrentUserProvider extends StateNotifier<UserDto?> with Mock implements CurrentUserProvider {
|
||||
MockCurrentUserProvider() : super(null);
|
||||
|
||||
@override
|
||||
|
||||
@@ -57,14 +57,11 @@ void main() {
|
||||
final MockExifInfoRepository exifInfoRepository = MockExifInfoRepository();
|
||||
final MockIsarUserRepository userRepository = MockIsarUserRepository();
|
||||
final MockETagRepository eTagRepository = MockETagRepository();
|
||||
final MockAlbumMediaRepository albumMediaRepository =
|
||||
MockAlbumMediaRepository();
|
||||
final MockAlbumMediaRepository albumMediaRepository = MockAlbumMediaRepository();
|
||||
final MockAlbumApiRepository albumApiRepository = MockAlbumApiRepository();
|
||||
final MockAppSettingService appSettingService = MockAppSettingService();
|
||||
final MockLocalFilesManagerRepository localFilesManagerRepository =
|
||||
MockLocalFilesManagerRepository();
|
||||
final MockPartnerApiRepository partnerApiRepository =
|
||||
MockPartnerApiRepository();
|
||||
final MockLocalFilesManagerRepository localFilesManagerRepository = MockLocalFilesManagerRepository();
|
||||
final MockPartnerApiRepository partnerApiRepository = MockPartnerApiRepository();
|
||||
final MockUserApiRepository userApiRepository = MockUserApiRepository();
|
||||
final MockPartnerRepository partnerRepository = MockPartnerRepository();
|
||||
final MockUserService userService = MockUserService();
|
||||
@@ -115,13 +112,11 @@ void main() {
|
||||
userApiRepository,
|
||||
);
|
||||
when(() => userService.getMyUser()).thenReturn(owner);
|
||||
when(() => eTagRepository.get(owner.id))
|
||||
.thenAnswer((_) async => ETag(id: owner.id, time: DateTime.now()));
|
||||
when(() => eTagRepository.get(owner.id)).thenAnswer((_) async => ETag(id: owner.id, time: DateTime.now()));
|
||||
when(() => eTagRepository.deleteByIds(["1"])).thenAnswer((_) async {});
|
||||
when(() => eTagRepository.upsertAll(any())).thenAnswer((_) async {});
|
||||
when(() => partnerRepository.getSharedWith()).thenAnswer((_) async => []);
|
||||
when(() => userRepository.getAll(sortBy: SortUserBy.id))
|
||||
.thenAnswer((_) async => [owner]);
|
||||
when(() => userRepository.getAll(sortBy: SortUserBy.id)).thenAnswer((_) async => [owner]);
|
||||
when(() => userRepository.getAll()).thenAnswer((_) async => [owner]);
|
||||
when(
|
||||
() => assetRepository.getAll(
|
||||
@@ -133,8 +128,7 @@ void main() {
|
||||
.thenAnswer((_) async => [initialAssets[3], null, null]);
|
||||
when(() => assetRepository.updateAll(any())).thenAnswer((_) async => []);
|
||||
when(() => assetRepository.deleteByIds(any())).thenAnswer((_) async {});
|
||||
when(() => exifInfoRepository.updateAll(any()))
|
||||
.thenAnswer((_) async => []);
|
||||
when(() => exifInfoRepository.updateAll(any())).thenAnswer((_) async => []);
|
||||
when(() => assetRepository.transaction<void>(any())).thenAnswer(
|
||||
(call) => (call.positionalArguments.first as Function).call(),
|
||||
);
|
||||
@@ -143,8 +137,7 @@ void main() {
|
||||
);
|
||||
when(() => userApiRepository.getAll()).thenAnswer((_) async => [owner]);
|
||||
registerFallbackValue(Direction.sharedByMe);
|
||||
when(() => partnerApiRepository.getAll(any()))
|
||||
.thenAnswer((_) async => []);
|
||||
when(() => partnerApiRepository.getAll(any())).thenAnswer((_) async => []);
|
||||
});
|
||||
test('test inserting existing assets', () async {
|
||||
final List<Asset> remoteAssets = [
|
||||
@@ -178,8 +171,7 @@ void main() {
|
||||
expect(c1, isTrue);
|
||||
final updatedAsset = initialAssets[3].updatedCopy(remoteAssets[3]);
|
||||
verify(
|
||||
() => assetRepository
|
||||
.updateAll([remoteAssets[4], remoteAssets[5], updatedAsset]),
|
||||
() => assetRepository.updateAll([remoteAssets[4], remoteAssets[5], updatedAsset]),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -244,8 +236,7 @@ void main() {
|
||||
return;
|
||||
});
|
||||
when(
|
||||
() => assetRepository
|
||||
.getAllByRemoteId(["2-1", "1-1"], state: AssetState.merged),
|
||||
() => assetRepository.getAllByRemoteId(["2-1", "1-1"], state: AssetState.merged),
|
||||
).thenAnswer((_) async => [initialAssets[2]]);
|
||||
when(() => assetRepository.getAllByOwnerIdChecksum(any(), any()))
|
||||
.thenAnswer((_) async => [initialAssets[0], null, null]); //afg
|
||||
|
||||
@@ -14,8 +14,7 @@ class _Counter {
|
||||
}
|
||||
|
||||
void main() {
|
||||
test('Executes the method immediately if no calls received previously',
|
||||
() async {
|
||||
test('Executes the method immediately if no calls received previously', () async {
|
||||
var counter = _Counter();
|
||||
final throttler = Throttler(interval: const Duration(milliseconds: 300));
|
||||
throttler.run(() => counter.increment());
|
||||
|
||||
@@ -28,9 +28,7 @@ void main() {
|
||||
expect(punycodeEncodeUrl(url), equals(expected));
|
||||
});
|
||||
|
||||
test(
|
||||
'should encode multi-segment Unicode host with multiple non-ASCII segments',
|
||||
() {
|
||||
test('should encode multi-segment Unicode host with multiple non-ASCII segments', () {
|
||||
const url = 'https://bücher.münchen';
|
||||
const expected = 'https://xn--bcher-kva.xn--mnchen-3ya';
|
||||
expect(punycodeEncodeUrl(url), equals(expected));
|
||||
|
||||
Reference in New Issue
Block a user