forked from eatvio/eatvio_app
refactor(tests): replace 'final' with 'const' for improved performance in various test files
This commit is contained in:
@@ -18,7 +18,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('creates loaded state with comment', () {
|
||||
final comment = CommentModel(
|
||||
const comment = CommentModel(
|
||||
data: [],
|
||||
links: Links(first: '', last: '', prev: null, next: null),
|
||||
meta: Meta(
|
||||
@@ -33,14 +33,14 @@ void main() {
|
||||
),
|
||||
);
|
||||
|
||||
final state = CommentsState.loaded(comment: comment);
|
||||
const state = CommentsState.loaded(comment: comment);
|
||||
|
||||
expect(state, isA<CommentsStateLoaded>());
|
||||
expect((state as CommentsStateLoaded).comment, comment);
|
||||
});
|
||||
|
||||
test('creates loaded state with replyId', () {
|
||||
final comment = CommentModel(
|
||||
const comment = CommentModel(
|
||||
data: [],
|
||||
links: Links(first: '', last: '', prev: null, next: null),
|
||||
meta: Meta(
|
||||
@@ -55,7 +55,7 @@ void main() {
|
||||
),
|
||||
);
|
||||
|
||||
final state = CommentsState.loaded(
|
||||
const state = CommentsState.loaded(
|
||||
comment: comment,
|
||||
replyId: 123,
|
||||
);
|
||||
@@ -64,7 +64,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('creates loaded state with editedCommentId', () {
|
||||
final comment = CommentModel(
|
||||
const comment = CommentModel(
|
||||
data: [],
|
||||
links: Links(first: '', last: '', prev: null, next: null),
|
||||
meta: Meta(
|
||||
@@ -79,7 +79,7 @@ void main() {
|
||||
),
|
||||
);
|
||||
|
||||
final state = CommentsState.loaded(
|
||||
const state = CommentsState.loaded(
|
||||
comment: comment,
|
||||
editedCommentId: 456,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user