Skip to content

Commit

Permalink
test getAllActions
Browse files Browse the repository at this point in the history
  • Loading branch information
Codel1417 committed Jun 4, 2024
1 parent 7e35d9d commit 56fb80d
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions test/Backend/action_registry_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:tail_app/Backend/Bluetooth/bluetooth_manager.dart';
import 'package:tail_app/Backend/Bluetooth/bluetooth_manager_plus.dart';
import 'package:tail_app/Backend/Definitions/Action/base_action.dart';
import 'package:tail_app/Backend/Definitions/Device/device_definition.dart';
import 'package:tail_app/Backend/action_registry.dart';

import '../testing_utils/gear_utils.dart';
Expand Down Expand Up @@ -69,4 +70,49 @@ void main() {
expect(actions.length, 0);
});
});

group('getAllActions', () {
test('All Actions', () {
final container = ProviderContainer(
overrides: [],
);
var actions = container.read(getAllActionsProvider(DeviceType.values.toSet()));
expect(actions.length, 5);
});
test('Tail Actions', () {
final container = ProviderContainer(
overrides: [],
);
var actions = container.read(getAllActionsProvider({DeviceType.tail}));
expect(actions.length, 4);
});
test('Ear Actions', () {
final container = ProviderContainer(
overrides: [],
);
var actions = container.read(getAllActionsProvider({DeviceType.ears}));
expect(actions.length, 1);
});
test('Wings Actions', () {
final container = ProviderContainer(
overrides: [],
);
var actions = container.read(getAllActionsProvider({DeviceType.wings}));
expect(actions.length, 3);
});
test('Mini Tail Actions', () {
final container = ProviderContainer(
overrides: [],
);
var actions = container.read(getAllActionsProvider({DeviceType.miniTail}));
expect(actions.length, 3);
});
test('No Actions', () {
final container = ProviderContainer(
overrides: [],
);
var actions = container.read(getAllActionsProvider({}));
expect(actions.length, 0);
});
});
}

0 comments on commit 56fb80d

Please sign in to comment.