Skip to content

Commit

Permalink
test(app): refactor drug page tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Sep 24, 2024
1 parent 785adaa commit 501dfd0
Show file tree
Hide file tree
Showing 8 changed files with 216 additions and 175 deletions.
367 changes: 203 additions & 164 deletions app/integration_test/drugs_test.dart

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:app/common/models/drug/warning_level.dart';

import '../guidelines/aripiprazole_cyp2d6_poor.dart';

final drugWithAnyNotHandledFallbackGuideline = Drug(
final aripiprazoleWithAnyNotHandledFallbackGuideline = Drug(
id: '6492f8e9918ddcae7349c30c',
version: 1,
name: 'aripiprazole',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:app/common/models/drug/drug.dart';
import 'package:app/common/models/drug/guideline.dart';
import 'package:app/common/models/drug/warning_level.dart';

final drugWithProperGuideline = Drug(
final ibuprofenWithProperGuideline = Drug(
id: '6407768b92a4868065b6c466',
version: 1,
name: 'ibuprofen',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:app/common/models/drug/drug.dart';

final drugWithoutGuidelines = Drug(
final mirabegronWithoutGuidelines = Drug(
id: '64c187431006f51bc6e24959',
version: 2,
name: 'mirabegron',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:app/common/models/drug/warning_level.dart';

import '../guidelines/pazopanib_hlab5701_positive_ugt1a1_poor_guideline.dart';

final drugWithMultipleAnyNotHandledFallbackGuidelines = Drug(
final pazopanibWithMultipleAnyNotHandledFallbackGuidelines = Drug(
id: '6686a865826414ec5b05c44e',
version: 1,
name: 'pazopanib',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:app/common/models/drug/drug.dart';
import 'package:app/common/models/drug/guideline.dart';
import 'package:app/common/models/drug/warning_level.dart';

final drugWithAnyFallbackGuideline = Drug(
final warfarinWithAnyFallbackGuideline = Drug(
id: '658df37b3aa92cbd80bbe352',
version: 1,
name: 'warfarin',
Expand Down
12 changes: 6 additions & 6 deletions app/integration_test/search_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import 'package:integration_test/integration_test.dart';
import 'package:mocktail/mocktail.dart';
import 'package:provider/provider.dart';

import 'fixtures/drugs/with_any_fallback_guideline.dart';
import 'fixtures/drugs/with_proper_guideline.dart';
import 'fixtures/drugs/without_guidelines.dart';
import 'fixtures/drugs/aripiprazole_with_any_not_handled_guideline.dart';
import 'fixtures/drugs/ibuprofen_with_proper_guideline.dart';
import 'fixtures/drugs/mirabegron_without_guidelines.dart';
import 'mocks/drug_list_cubit.dart';

void main() {
Expand All @@ -18,9 +18,9 @@ void main() {

binding.framePolicy = LiveTestWidgetsFlutterBindingFramePolicy.onlyPumps;
final loadedDrugs = [
drugWithProperGuideline,
drugWithoutGuidelines,
drugWithAnyFallbackGuideline,
ibuprofenWithProperGuideline,
mirabegronWithoutGuidelines,
aripiprazoleWithAnyNotHandledFallbackGuideline,
];
group('integration test for the search page', () {
testWidgets('test search page in loading state', (tester) async {
Expand Down
2 changes: 2 additions & 0 deletions pharme.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"aripiprazole",
"atorvastatin",
"Backupper",
"brandnames",
"bupropion",
"cinacalcet",
"citalopram",
Expand Down Expand Up @@ -113,6 +114,7 @@
"unstaged",
"userdata",
"Vicoprofen",
"VKORC",
"voriconazole",
"Votrient"
],
Expand Down

0 comments on commit 501dfd0

Please sign in to comment.