forked from eatvio/eatvio_app
refactor(tests): replace 'final' with 'const' for improved performance in various test files
This commit is contained in:
@@ -4,7 +4,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
void main() {
|
||||
group('Links', () {
|
||||
test('creates Links with all parameters', () {
|
||||
final links = Links(
|
||||
const links = Links(
|
||||
first: 'http://example.com?page=1',
|
||||
last: 'http://example.com?page=10',
|
||||
prev: 'http://example.com?page=2',
|
||||
@@ -18,7 +18,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('creates Links with null prev and next', () {
|
||||
final links = Links(
|
||||
const links = Links(
|
||||
first: 'http://example.com?page=1',
|
||||
last: 'http://example.com?page=10',
|
||||
prev: null,
|
||||
@@ -32,7 +32,7 @@ void main() {
|
||||
|
||||
group('Link', () {
|
||||
test('creates Link with all parameters', () {
|
||||
final link = Link(
|
||||
const link = Link(
|
||||
url: 'http://example.com?page=1',
|
||||
label: '1',
|
||||
active: true,
|
||||
@@ -44,7 +44,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('creates Link with null values', () {
|
||||
final link = Link(
|
||||
const link = Link(
|
||||
url: null,
|
||||
label: null,
|
||||
active: null,
|
||||
@@ -58,7 +58,7 @@ void main() {
|
||||
|
||||
group('Meta', () {
|
||||
test('creates Meta with all parameters', () {
|
||||
final meta = Meta(
|
||||
const meta = Meta(
|
||||
currentPage: 1,
|
||||
from: 1,
|
||||
lastPage: 10,
|
||||
@@ -80,7 +80,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('creates Meta with null optional values', () {
|
||||
final meta = Meta(
|
||||
const meta = Meta(
|
||||
currentPage: 1,
|
||||
from: null,
|
||||
lastPage: 10,
|
||||
@@ -99,12 +99,12 @@ void main() {
|
||||
});
|
||||
|
||||
test('creates Meta with links list', () {
|
||||
final links = [
|
||||
const links = [
|
||||
Link(url: 'http://example.com?page=1', label: '1', active: true),
|
||||
Link(url: 'http://example.com?page=2', label: '2', active: false),
|
||||
];
|
||||
|
||||
final meta = Meta(
|
||||
const meta = Meta(
|
||||
currentPage: 1,
|
||||
from: 1,
|
||||
lastPage: 10,
|
||||
|
||||
Reference in New Issue
Block a user