Skip to content

Commit

Permalink
Fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ashuntu committed Dec 11, 2024
1 parent 15b79c1 commit bb8ed80
Showing 1 changed file with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,27 +183,29 @@ void main() {

// check that we transitioned to the LandscapePage
l10n = tester.l10n<LandscapePage>();
final selfHostedRadio = find.ancestor(
of: find.text(l10n.landscapeQuickSetupSelfHosted),
matching: find.byType(YaruSelectableContainer),
);
final continueButton = find.button(l10n.buttonNext);
final continueButton = find.button(l10n.landscapeRegister);

// check that invalid input disables continue
await tester.tap(selfHostedRadio);
await tester.tap(find.text(l10n.landscapeSetupManual));
await tester.pump();
final fqdnInput = find.ancestor(
of: find.text(l10n.landscapeFQDNLabel),
matching: find.byType(TextField),
);
await tester.enterText(fqdnInput, '::');
await tester.pump();
expect(tester.widget<ElevatedButton>(continueButton).enabled, isFalse);
expect(
tester.widget<ButtonStyleButton>(continueButton).enabled,
isFalse,
);

// check that valid input enabled continue, and continue
await tester.enterText(fqdnInput, 'localhost');
await tester.pump();
expect(tester.widget<ElevatedButton>(continueButton).enabled, isTrue);
expect(
tester.widget<ButtonStyleButton>(continueButton).enabled,
isTrue,
);
await tester.tap(continueButton);
await tester.pumpAndSettle();

Expand Down Expand Up @@ -324,19 +326,15 @@ landscape:
await tester.tap(landscapeButton);
await tester.pumpAndSettle();
final landscapeL10n = tester.l10n<LandscapePage>();
final selfHosted = find.ancestor(
of: find.text(landscapeL10n.landscapeQuickSetupSelfHosted),
matching: find.byType(YaruSelectableContainer),
);
await tester.tap(selfHosted);
await tester.tap(find.text(l10n.landscapeSetupManual));
final fqdnInput = find.ancestor(
of: find.text(landscapeL10n.landscapeFQDNLabel),
matching: find.byType(TextField),
);
await tester.tap(fqdnInput);
await tester.enterText(fqdnInput, 'localhost');
await tester.pump();
final continueButton = find.button(landscapeL10n.buttonNext);
final continueButton = find.button(landscapeL10n.landscapeRegister);
await tester.tap(continueButton);
await tester.pumpAndSettle();

Expand Down

0 comments on commit bb8ed80

Please sign in to comment.