Merge remote-tracking branch 'origin/feat/first-run' into feat/l-for-details
This commit is contained in:
commit
dee144f33f
4 files changed
+107
-1
No files matched your search
@@ -1238,3 +1238,36 @@ func TestStatusPane(t *testing.T) {
|
||||
t.Errorf("back to %v", d.m.focus)
|
||||
}
|
||||
}
|
||||
|
||||
// empty is an account with nothing in it, like Databricks without profiles.
|
||||
type empty struct{ provider.Provider }
|
||||
|
||||
func (empty) Sources(context.Context) ([]provider.Source, error) { return nil, nil }
|
||||
|
||||
func TestGetStarted(t *testing.T) {
|
||||
t.Parallel()
|
||||
d := newDriverOpts(t, Options{}, signedOut{fake.Azure(0)}, empty{fake.Databricks(0)})
|
||||
scr := d.screen()
|
||||
for _, want := range []string{"get started", "Azure az login", "L runs it here",
|
||||
"databricks auth login --host", "lazysecrets --demo"} {
|
||||
if !strings.Contains(scr, want) {
|
||||
t.Errorf("missing %q:\n%s", want, scr)
|
||||
}
|
||||
}
|
||||
d.keys("l", "j")
|
||||
if a := d.m.loginFor(); a == nil || a.Account != "Azure · admin" {
|
||||
t.Errorf("L signs in to %+v", a)
|
||||
}
|
||||
d.keys("y")
|
||||
if got := d.clip().content; got != "az login" {
|
||||
t.Errorf("y copied %q", got)
|
||||
}
|
||||
|
||||
// Once an account has something, an empty one says what it needs.
|
||||
d = newDriverOpts(t, Options{}, fake.Azure(0), empty{fake.Databricks(0)})
|
||||
d.m.sources.SelectWhere(func(r sourceRow) bool { return r.kind == rowGroup && r.provider == fake.Databricks(0).ID() })
|
||||
d.send(nil)
|
||||
if scr := d.screen(); strings.Contains(scr, "get started") || !strings.Contains(scr, "databricks auth login") {
|
||||
t.Errorf("empty Databricks:\n%s", scr)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user