refactor(tests): replace 'final' with 'const' for improved performance in various test files

This commit is contained in:
mso7nueh
2025-12-08 11:32:40 +03:00
parent c2a506cdbf
commit 746d366c18
56 changed files with 199 additions and 254 deletions

View File

@@ -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,
);