Skip to content

Commit

Permalink
chore(app-center): remove listMyVotes
Browse files Browse the repository at this point in the history
  • Loading branch information
d-loose committed Dec 13, 2024
1 parent a6ec100 commit 6485eeb
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 38 deletions.
5 changes: 0 additions & 5 deletions packages/app_center/lib/ratings/ratings_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ class RatingsService {
await client.delete(_jwt!);
}

Future<List<ratings.Vote>> listMyVotes(String snapFilter) async {
await _ensureValidToken();
return client.listMyVotes(snapFilter, _jwt!);
}

Future<List<ratings.Vote>> getSnapVotes(String snapId) async {
await _ensureValidToken();
return client.getSnapVotes(snapId, _jwt!);
Expand Down
31 changes: 0 additions & 31 deletions packages/app_center/test/ratings_service_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,37 +106,6 @@ void main() {
verify(mockClient.delete('jwt')).called(1);
});

test('list my votes', () async {
final mockClient = createMockRatingsClient(
token: 'jwt',
myVotes: [
Vote(
snapId: 'testsnap',
snapRevision: 1,
voteUp: false,
dateTime: DateTime(1984),
),
],
);
final service = RatingsService(mockClient, id: 'myId');

final votes = await service.listMyVotes('testsnap');
verify(mockClient.authenticate('myId')).called(1);
expect(
votes,
equals(
[
Vote(
snapId: 'testsnap',
snapRevision: 1,
voteUp: false,
dateTime: DateTime(1984),
),
],
),
);
});

test('snap votes', () async {
final mockClient = createMockRatingsClient(
token: 'jwt',
Expand Down
2 changes: 0 additions & 2 deletions packages/app_center/test/test_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@ MockRatingsService registerMockRatingsService({
MockRatingsClient createMockRatingsClient({
String? token,
Rating? rating,
List<Vote>? myVotes,
List<Vote>? snapVotes,
List<ChartData>? chartData,
}) {
Expand All @@ -331,7 +330,6 @@ MockRatingsClient createMockRatingsClient({
ratingsBand: RatingsBand.insufficientVotes,
),
);
when(client.listMyVotes(any, any)).thenAnswer((_) async => myVotes ?? []);
when(client.getSnapVotes(any, any)).thenAnswer((_) async => snapVotes ?? []);
when(client.getChart(any, any, any)).thenAnswer((_) async => chartData ?? []);
return client;
Expand Down

0 comments on commit 6485eeb

Please sign in to comment.