mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: rebucket "Number of developers" onboarding options (#24573)
This commit is contained in:
+14
-2
@@ -599,10 +599,22 @@ func promptTrialInfo(inv *serpent.Invocation, fieldName string) (string, error)
|
||||
return value, nil
|
||||
}
|
||||
|
||||
// developerBuckets are the options offered for the "Number of developers"
|
||||
// prompt during first-user setup. Keep in sync with
|
||||
// site/src/pages/SetupPage/SetupPageView.tsx (numberOfDevelopersOptions).
|
||||
var developerBuckets = []string{
|
||||
"1 - 50",
|
||||
"51 - 100",
|
||||
"101 - 200",
|
||||
"201 - 500",
|
||||
"501 - 1000",
|
||||
"1001 - 2500",
|
||||
"2500+",
|
||||
}
|
||||
|
||||
func promptDevelopers(inv *serpent.Invocation) (string, error) {
|
||||
options := []string{"1-100", "101-500", "501-1000", "1001-2500", "2500+"}
|
||||
selection, err := cliui.Select(inv, cliui.SelectOptions{
|
||||
Options: options,
|
||||
Options: developerBuckets,
|
||||
HideSearch: false,
|
||||
Message: "Select the number of developers:",
|
||||
})
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
// TestDeveloperBuckets pins the set of options offered for the
|
||||
// "Number of developers" prompt. If this test fails, also update the
|
||||
// matching list in site/src/pages/SetupPage/SetupPageView.tsx
|
||||
// (numberOfDevelopersOptions) and coordinate with the licensor service owner,
|
||||
// since the same string is forwarded to v2-licensor.coder.com/trial.
|
||||
func TestDeveloperBuckets(t *testing.T) {
|
||||
t.Parallel()
|
||||
require.Equal(t, []string{
|
||||
"1 - 50",
|
||||
"51 - 100",
|
||||
"101 - 200",
|
||||
"201 - 500",
|
||||
"501 - 1000",
|
||||
"1001 - 2500",
|
||||
"2500+",
|
||||
}, developerBuckets)
|
||||
}
|
||||
Reference in New Issue
Block a user