-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: shorebird preview to identify shorebird projects with flavors #1854
Changes from 3 commits
f25debf
a15d0af
8c3cb66
6efc52b
2ea9b3e
805b968
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
erickzanardo marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -712,7 +712,7 @@ channel: ${track.channel} | |
verifyNever(() => codePushClientWrapper.getApps()); | ||
}); | ||
|
||
test('prompts for app id when in shorebird project with flavors', | ||
test('prompts for the flavor when in shorebird project with flavors', | ||
() async { | ||
when(() => shorebirdEnv.getShorebirdYaml()).thenReturn( | ||
const ShorebirdYaml( | ||
|
@@ -723,20 +723,18 @@ channel: ${track.channel} | |
when(() => argResults.wasParsed('app-id')).thenReturn(false); | ||
when(() => argResults['app-id']).thenReturn(null); | ||
when( | ||
() => logger.chooseOne<AppMetadata>( | ||
() => logger.chooseOne<String>( | ||
any(), | ||
choices: any(named: 'choices'), | ||
display: any(named: 'display'), | ||
), | ||
).thenReturn(app); | ||
).thenReturn('dev'); | ||
|
||
await runWithOverrides(command.run); | ||
|
||
verify( | ||
() => logger.chooseOne<AppMetadata>( | ||
'Which app would you like to preview?', | ||
() => logger.chooseOne<String>( | ||
any(), | ||
choices: any(named: 'choices'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should probably verify that the flavors were provided as arguments to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair enought! I've changed it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you push? I'm still seeing: verify(
() => logger.chooseOne<String>(
any(), There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah! The issue is just that the test only has a single flavor. We should probably update that (and maybe change the command to not prompt if only one flavor is present, although that seems like sort of a silly setup) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, yeah, fair point! Should we do that handling in a different PR though? I feel that this PR is addressing the detecting a shorebird project that has flavors, no matter the number, then auto selecting the only flavor would probably be a change of its own? Let me know if you agree, otherwise I am happy to update this PR to include this as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the "single flavor" fix can be done in a future PR (if ever), but the test should probably be updated to include more than one flavor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair enough, I've updated it |
||
display: any(named: 'display'), | ||
), | ||
).called(1); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we gain much by wrapping this in its own function, as the call to
logger.chooseOne
is not substantially more complex than the call topromptForFlavor
.