chore: alphabetize template list (#3363)

This commit is contained in:
Ben Potter
2022-08-05 13:03:22 -05:00
committed by GitHub
parent 854bb5dbeb
commit f14efd1a2b
4 changed files with 16 additions and 10 deletions
+8 -2
View File
@@ -1,6 +1,7 @@
package cli_test
import (
"sort"
"testing"
"github.com/stretchr/testify/require"
@@ -36,10 +37,15 @@ func TestTemplateList(t *testing.T) {
errC <- cmd.Execute()
}()
// expect that templates are listed alphebetically
var templatesList = []string{firstTemplate.Name, secondTemplate.Name}
sort.Strings(templatesList)
require.NoError(t, <-errC)
pty.ExpectMatch(firstTemplate.Name)
pty.ExpectMatch(secondTemplate.Name)
for _, name := range templatesList {
pty.ExpectMatch(name)
}
})
t.Run("NoTemplates", func(t *testing.T) {
t.Parallel()