feat(tutorial): wire tutorial carousel into the first-launch flow

Insert PantallaTutorialAyuda.mostrarSiProcede between the welcome
screen and the recurring what's-new dialog in
_mostrarFlujoPrimerLanzamiento, so the carousel shows once on every
install -- fresh AND existing installs upgrading to this version --
via its own independent one-time flag, without racing either
surface.
This commit is contained in:
2026-08-01 11:44:25 +02:00
parent 015a20a823
commit e297413145
4 changed files with 90 additions and 153 deletions
+49
View File
@@ -20,4 +20,53 @@ void main() {
'PluriRootHeader inside its content instead',
);
});
test('the first-launch sequence runs the welcome screen, then the tutorial '
'carousel, then the recurring what-is-new dialog, in that order', () {
// `_PaginaPrincipal` is library-private and its
// `_mostrarFlujoPrimerLanzamiento` constructs real platform-backed
// services, so it cannot be safely widget-tested here (same
// constraint as the AppBar guard above). This is a fast source-level
// ordering guard instead: PantallaBienvenida.mostrarSiProcede must
// run before PantallaTutorialAyuda.mostrarSiProcede, which must run
// before the unrelated, pre-existing _mostrarOnboardingInicial() call
// -- so the tutorial shows once on every launch sequence (fresh
// installs AND existing installs upgrading to this version) without
// ever racing the welcome screen or the what's-new dialog.
final source = File('lib/app.dart').readAsStringSync();
final indiceBienvenida = source.indexOf(
'PantallaBienvenida.mostrarSiProcede',
);
final indiceTutorial = source.indexOf(
'PantallaTutorialAyuda.mostrarSiProcede',
);
final indiceOnboarding = source.indexOf('_mostrarOnboardingInicial()');
expect(
indiceBienvenida,
greaterThanOrEqualTo(0),
reason: 'PantallaBienvenida.mostrarSiProcede must still be called',
);
expect(
indiceTutorial,
greaterThanOrEqualTo(0),
reason: 'PantallaTutorialAyuda.mostrarSiProcede must be wired in',
);
expect(
indiceOnboarding,
greaterThanOrEqualTo(0),
reason: '_mostrarOnboardingInicial() must still be called',
);
expect(
indiceBienvenida,
lessThan(indiceTutorial),
reason: 'the welcome screen must run before the tutorial carousel',
);
expect(
indiceTutorial,
lessThan(indiceOnboarding),
reason: 'the tutorial carousel must run before the what-is-new dialog',
);
});
}