Skip to content

Commit

Permalink
Regen mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartmorgan committed Sep 30, 2024
1 parent 875e641 commit 2ccc25f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ class MockTestFileSelectorApi extends _i1.Mock
}

@override
_i3.Future<List<String?>> openFile(_i4.FileSelectorConfig? config) =>
_i3.Future<List<String>> openFile(_i4.FileSelectorConfig? config) =>
(super.noSuchMethod(
Invocation.method(
#openFile,
[config],
),
returnValue: _i3.Future<List<String?>>.value(<String?>[]),
) as _i3.Future<List<String?>>);
returnValue: _i3.Future<List<String>>.value(<String>[]),
) as _i3.Future<List<String>>);
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void main() {
// Set default stubs for tests that don't expect a specific return value,
// so calls don't throw. Tests that `expect` return values should override
// these locally.
when(mockApi.displayOpenPanel(any)).thenAnswer((_) async => <String?>[]);
when(mockApi.displayOpenPanel(any)).thenAnswer((_) async => <String>[]);
when(mockApi.displaySavePanel(any)).thenAnswer((_) async => null);
});

Expand All @@ -39,7 +39,7 @@ void main() {
group('openFile', () {
test('works as expected with no arguments', () async {
when(mockApi.displayOpenPanel(any))
.thenAnswer((_) async => <String?>['foo']);
.thenAnswer((_) async => <String>['foo']);

final XFile? file = await plugin.openFile();

Expand All @@ -57,7 +57,7 @@ void main() {
});

test('handles cancel', () async {
when(mockApi.displayOpenPanel(any)).thenAnswer((_) async => <String?>[]);
when(mockApi.displayOpenPanel(any)).thenAnswer((_) async => <String>[]);

final XFile? file = await plugin.openFile();

Expand Down Expand Up @@ -134,7 +134,7 @@ void main() {
group('openFiles', () {
test('works as expected with no arguments', () async {
when(mockApi.displayOpenPanel(any))
.thenAnswer((_) async => <String?>['foo', 'bar']);
.thenAnswer((_) async => <String>['foo', 'bar']);

final List<XFile> files = await plugin.openFiles();

Expand All @@ -153,7 +153,7 @@ void main() {
});

test('handles cancel', () async {
when(mockApi.displayOpenPanel(any)).thenAnswer((_) async => <String?>[]);
when(mockApi.displayOpenPanel(any)).thenAnswer((_) async => <String>[]);

final List<XFile> files = await plugin.openFiles();

Expand Down Expand Up @@ -467,7 +467,7 @@ void main() {
group('getDirectoryPath', () {
test('works as expected with no arguments', () async {
when(mockApi.displayOpenPanel(any))
.thenAnswer((_) async => <String?>['foo']);
.thenAnswer((_) async => <String>['foo']);

final String? path = await plugin.getDirectoryPath();

Expand All @@ -485,7 +485,7 @@ void main() {
});

test('handles cancel', () async {
when(mockApi.displayOpenPanel(any)).thenAnswer((_) async => <String?>[]);
when(mockApi.displayOpenPanel(any)).thenAnswer((_) async => <String>[]);

final String? path = await plugin.getDirectoryPath();

Expand Down Expand Up @@ -533,7 +533,7 @@ void main() {
});

test('handles cancel', () async {
when(mockApi.displayOpenPanel(any)).thenAnswer((_) async => <String?>[]);
when(mockApi.displayOpenPanel(any)).thenAnswer((_) async => <String>[]);

final List<String> paths = await plugin.getDirectoryPaths();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ class MockTestFileSelectorApi extends _i1.Mock
}

@override
_i3.Future<List<String?>> displayOpenPanel(_i4.OpenPanelOptions? options) =>
_i3.Future<List<String>> displayOpenPanel(_i4.OpenPanelOptions? options) =>
(super.noSuchMethod(
Invocation.method(
#displayOpenPanel,
[options],
),
returnValue: _i3.Future<List<String?>>.value(<String?>[]),
) as _i3.Future<List<String?>>);
returnValue: _i3.Future<List<String>>.value(<String>[]),
) as _i3.Future<List<String>>);

@override
_i3.Future<String?> displaySavePanel(_i4.SavePanelOptions? options) =>
Expand Down

0 comments on commit 2ccc25f

Please sign in to comment.