-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor/consolidate moderation status #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b9903c1
84bb2b0
198286b
5961860
5a701d4
ce4211c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import 'package:json_annotation/json_annotation.dart'; | ||
|
|
||
| /// {@template moderation_status} | ||
| /// Defines the moderation status of a user-submitted content, such as a | ||
| /// comment or a report. | ||
| /// {@endtemplate} | ||
| @JsonEnum() | ||
| enum ModerationStatus { | ||
| /// The item has been submitted and is awaiting moderation. | ||
| @JsonValue('pendingReview') | ||
| pendingReview, | ||
|
|
||
| /// The item has been reviewed and a decision has been made. | ||
| @JsonValue('resolved') | ||
| resolved, | ||
| } | ||
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import 'package:core/src/enums/moderation_status.dart'; | ||
| import 'package:test/test.dart'; | ||
|
|
||
| void main() { | ||
| group('ModerationStatus', () { | ||
| test('has correct values', () { | ||
| expect( | ||
| ModerationStatus.values, | ||
| containsAll([ | ||
| ModerationStatus.pendingReview, | ||
| ModerationStatus.resolved, | ||
| ]), | ||
| ); | ||
| }); | ||
|
|
||
| test('has correct string values', () { | ||
| expect(ModerationStatus.pendingReview.name, 'pendingReview'); | ||
| expect(ModerationStatus.resolved.name, 'resolved'); | ||
| }); | ||
|
|
||
| test('can be created from string values', () { | ||
| expect( | ||
| ModerationStatus.values.byName('pendingReview'), | ||
| ModerationStatus.pendingReview, | ||
| ); | ||
| expect( | ||
| ModerationStatus.values.byName('resolved'), | ||
| ModerationStatus.resolved, | ||
| ); | ||
| }); | ||
| }); | ||
| } |
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.