tests: cli, app chart list/show
@@ -7,17 +7,49 @@ import (
// [x] apps chart default
// [x] apps chart default NAME
-// [ ] apps chart list
-// [ ] apps chart show NAME
+// [x] apps chart list
+// [x] apps chart show NAME
// [ ] apps chart create [--short TEXT] [--desc TEXT] [--helm-repo REPO] NAME REF
// [ ] apps chart delete NAME
var _ = Describe("apps chart", func() {
- Describe("app chart default", func() {
- BeforeEach(func() {
+
+ Describe("app chart list", func() {
+ It("list the standard app chart", func() {
+ out, err := env.Epinio("", "apps", "chart", "list")
+ Expect(err).ToNot(HaveOccurred(), out)
+ Expect(out).To(ContainSubstring("Show Application Charts"))
+ Expect(out).To(MatchRegexp(`DEFAULT *| *NAME *| *DESCRIPTION`))
+ Expect(out).To(MatchRegexp(`standard *| *Epinio standard deployment`))
+ })
+ })
+
+ Describe("app chart show", func() {
+ It("shows the details of standard app chart", func() {
+ out, err := env.Epinio("", "apps", "chart", "show", "standard")
+ Expect(err).ToNot(HaveOccurred(), out)
+ Expect(out).To(ContainSubstring("Show application chart details"))
+ Expect(out).To(MatchRegexp(`Key *| *VALUE`))
+ Expect(out).To(MatchRegexp(`Name *| *standard`))
+ Expect(out).To(MatchRegexp(`Short *| *Epinio standard deployment`))
+ Expect(out).To(MatchRegexp(`Description *| *Epinio standard support chart`))
+ Expect(out).To(MatchRegexp(`for application deployment`))
+ Expect(out).To(MatchRegexp(`Helm Repository *| *https://epinio.github.io/helm-charts`))
+ Expect(out).To(MatchRegexp(`Helm chart *| *epinio-application:`))
})
+ It("fails to show the details of bogus app chart", func() {
+ out, err := env.Epinio("", "apps", "chart", "show", "bogus")
+ Expect(err).To(HaveOccurred(), out)
+ Expect(out).To(ContainSubstring("Show application chart details"))
+ Expect(out).To(ContainSubstring("Not Found: Application Chart 'bogus' does not exist"))
+ })
+ })
+
+ Describe("app chart default", func() {
AfterEach(func() {
+ // Reset to empty default as the state to be seen at the
+ // beginning of each test, regardless of ordering.
out, err := env.Epinio("", "apps", "chart", "default", "")
Expect(err).ToNot(HaveOccurred(), out)
})
