Skip to content

Commit

Permalink
Add missing trailing commas
Browse files Browse the repository at this point in the history
  • Loading branch information
ashuntu committed Jul 12, 2024
1 parent cceb431 commit 9890b29
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 17 deletions.
13 changes: 8 additions & 5 deletions packages/app_center_ratings_client/lib/src/ratings_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,15 @@ class RatingsClient {
await _userClient.delete(request, options: callOptions);
}

Future<List<ChartData>> getChart(Timeframe timeframe, String token,
[int? category]) async {
Future<List<ChartData>> getChart(
Timeframe timeframe,
String token, [
int? category,
]) async {
final request = chart_pb.GetChartRequest(
timeframe: timeframe.toDTO(),
category:
category != null ? chart_pb.Category.valueOf(category) : null);
timeframe: timeframe.toDTO(),
category: category != null ? chart_pb.Category.valueOf(category) : null,
);
final callOptions =
CallOptions(metadata: {'authorization': 'Bearer $token'});
final grpcResponse =
Expand Down
31 changes: 19 additions & 12 deletions packages/app_center_ratings_client/test/ratings_client_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@ void main() {
const timeframe = chart.Timeframe.month;
final pbChartList = [
pb_chart.ChartData(
rawRating: 3,
rating: Rating(
snapId: snapId,
totalVotes: Int64(105),
ratingsBand: RatingsBand.NEUTRAL,
))
rawRating: 3,
rating: Rating(
snapId: snapId,
totalVotes: Int64(105),
ratingsBand: RatingsBand.NEUTRAL,
),
),
];

final expectedResponse = [
Expand All @@ -61,13 +62,19 @@ void main() {
timeframe: pb_chart.Timeframe.TIMEFRAME_MONTH,
category: pb_chart.Category.GAMES,
);
when(mockChartClient.getChart(
request,
options: anyNamed('options'),
)).thenAnswer(
(_) => MockResponseFuture<pb_chart.GetChartResponse>(mockResponse));
when(
mockChartClient.getChart(
request,
options: anyNamed('options'),
),
).thenAnswer(
(_) => MockResponseFuture<pb_chart.GetChartResponse>(mockResponse),
);
final response = await ratingsClient.getChart(
timeframe, token, pb_chart.Category.GAMES.value);
timeframe,
token,
pb_chart.Category.GAMES.value,
);
expect(
response,
equals(expectedResponse),
Expand Down

0 comments on commit 9890b29

Please sign in to comment.