Skip to content

Commit

Permalink
Remove useless socket override in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
julien4215 committed Dec 26, 2024
1 parent a9baf8c commit 6322ec8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 28 deletions.
8 changes: 1 addition & 7 deletions test/view/broadcast/broadcast_game_screen_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,14 @@ final client = MockClient((request) {
void main() {
group('Broadcast game screen', () {
testWidgets('Displays broadcast game screen', variant: kPlatformVariant, (tester) async {
final fakeSocket = FakeWebSocketChannel();
final app = await makeTestProviderScopeApp(
tester,
home: const BroadcastGameScreen(
tournamentId: _tournamentId,
roundId: _roundId,
gameId: _gameId,
),
overrides: [
lichessClientProvider.overrideWith((ref) => LichessClient(client, ref)),
webSocketChannelFactoryProvider.overrideWith((ref) {
return FakeWebSocketChannelFactory((_) => fakeSocket);
}),
],
overrides: [lichessClientProvider.overrideWith((ref) => LichessClient(client, ref))],
);

await tester.pumpWidget(app);
Expand Down
24 changes: 3 additions & 21 deletions test/view/broadcast/broadcast_round_screen_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,10 @@ final client = MockClient((request) {
void main() {
group('Broadcast round screen', () {
testWidgets('Displays broadcast round screen', variant: kPlatformVariant, (tester) async {
final fakeSocket = FakeWebSocketChannel();
final app = await makeTestProviderScopeApp(
tester,
home: BroadcastRoundScreen(broadcast: _broadcast),
overrides: [
lichessClientProvider.overrideWith((ref) => LichessClient(client, ref)),
webSocketChannelFactoryProvider.overrideWith((ref) {
return FakeWebSocketChannelFactory((_) => fakeSocket);
}),
],
overrides: [lichessClientProvider.overrideWith((ref) => LichessClient(client, ref))],
);

await tester.pumpWidget(app);
Expand All @@ -75,16 +69,10 @@ void main() {
variant: TargetPlatformVariant.only(TargetPlatform.android),
(tester) async {
mockNetworkImagesFor(() async {
final fakeSocket = FakeWebSocketChannel();
final app = await makeTestProviderScopeApp(
tester,
home: BroadcastRoundScreen(broadcast: _broadcast),
overrides: [
lichessClientProvider.overrideWith((ref) => LichessClient(client, ref)),
webSocketChannelFactoryProvider.overrideWith((ref) {
return FakeWebSocketChannelFactory((_) => fakeSocket);
}),
],
overrides: [lichessClientProvider.overrideWith((ref) => LichessClient(client, ref))],
);

await tester.pumpWidget(app);
Expand Down Expand Up @@ -117,16 +105,10 @@ void main() {
variant: TargetPlatformVariant.only(TargetPlatform.iOS),
(tester) async {
mockNetworkImagesFor(() async {
final fakeSocket = FakeWebSocketChannel();
final app = await makeTestProviderScopeApp(
tester,
home: BroadcastRoundScreen(broadcast: _broadcast),
overrides: [
lichessClientProvider.overrideWith((ref) => LichessClient(client, ref)),
webSocketChannelFactoryProvider.overrideWith((ref) {
return FakeWebSocketChannelFactory((_) => fakeSocket);
}),
],
overrides: [lichessClientProvider.overrideWith((ref) => LichessClient(client, ref))],
);

await tester.pumpWidget(app);
Expand Down

0 comments on commit 6322ec8

Please sign in to comment.