Skip to content

Commit ce4211c

Browse files
committed
refactor(fixtures): update status values and resolve issues
- Change CommentStatus to ModerationStatus in headline_comments.dart - Change ReportStatus to ModerationStatus in reports.dart - Fix varying status values for realism in both files - Address headline entity ID assignment in reports.dart
1 parent 5a701d4 commit ce4211c

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

lib/src/fixtures/headline_comments.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,10 @@ List<Comment> getHeadlineCommentsFixturesData({
5454
for (var j = 0; j < 10; j++) {
5555
final commentIndex = i * 10 + j;
5656

57-
// Vary the status for realism
58-
var status = CommentStatus.approved;
57+
// Vary the status for realism. Default to resolved.
58+
var status = ModerationStatus.resolved;
5959
if (commentIndex % 15 == 0) {
60-
status = CommentStatus.pendingReview;
61-
} else if (commentIndex % 25 == 0) {
62-
status = CommentStatus.rejected;
60+
status = ModerationStatus.pendingReview;
6361
}
6462

6563
comments.add(

lib/src/fixtures/reports.dart

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,10 @@ List<Report> getReportsFixturesData({DateTime? now}) {
3535

3636
for (var i = 0; i < users.length; i++) {
3737
final user = users[i];
38-
final headline = headlines[i];
39-
var status = ReportStatus.submitted;
40-
if (i % 3 == 0) {
41-
status = ReportStatus.inReview;
42-
} else if (i % 5 == 0) {
43-
status = ReportStatus.resolved;
38+
var status = ModerationStatus.pendingReview;
39+
// Every 4th report is resolved
40+
if (i > 0 && i % 4 == 0) {
41+
status = ModerationStatus.resolved;
4442
}
4543

4644
// Create a mix of report types
@@ -51,7 +49,7 @@ List<Report> getReportsFixturesData({DateTime? now}) {
5149
id: reportIds[i],
5250
reporterUserId: user.id,
5351
entityType: ReportableEntity.headline,
54-
entityId: headline.id,
52+
entityId: headlines[i].id,
5553
reason: headlineReasons[i % headlineReasons.length].name,
5654
additionalComments: 'This headline seems misleading.',
5755
status: status,

0 commit comments

Comments
 (0)