Skip to content

Commit 69ae21b

Browse files
fixed unit tests
1 parent 7c370d3 commit 69ae21b

2 files changed

Lines changed: 4 additions & 19 deletions

File tree

plugin/commands/user/edit_notifications_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ var _ = Describe("User Edit Notifications", func() {
8989
It("Enable notification that does not exist", func() {
9090
err := testhelpers.RunCobraCommand(cliCommand.Command, "--enable='Order Email'")
9191
Expect(err).NotTo(HaveOccurred())
92-
Expect(fakeUI.Outputs()).To(ContainSubstring("Notifications updated unsuccessfully: 'Order Email'. Review if already set or if the name is correct."))
92+
Expect(fakeUI.Outputs()).To(ContainSubstring("Notifications updated unsuccessfully: 'Order Email'"))
9393
})
9494

9595
It("Enable notification that does not exist in json output format", func() {
@@ -107,7 +107,7 @@ var _ = Describe("User Edit Notifications", func() {
107107
It("Disable notification that does not exist", func() {
108108
err := testhelpers.RunCobraCommand(cliCommand.Command, "--disable='Order Email'")
109109
Expect(err).NotTo(HaveOccurred())
110-
Expect(fakeUI.Outputs()).To(ContainSubstring("Notifications updated unsuccessfully: 'Order Email'. Review if already set or if the name is correct."))
110+
Expect(fakeUI.Outputs()).To(ContainSubstring("Notifications updated unsuccessfully: 'Order Email'"))
111111
})
112112
})
113113
})

plugin/i18n/i18n_test.go

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package i18n_test
22

33
import (
4-
"encoding/json"
4+
55
"fmt"
66
"github.com/IBM-Cloud/ibm-cloud-cli-sdk/bluemix/configuration/core_config"
77
. "github.com/onsi/ginkgo/v2"
@@ -10,7 +10,7 @@ import (
1010
"github.ibm.com/SoftLayer/softlayer-cli/plugin/i18n"
1111
"io/ioutil"
1212
"os"
13-
"regexp"
13+
1414
"strings"
1515
"testing"
1616
)
@@ -62,21 +62,6 @@ var _ = Describe("I18NTests", func() {
6262
i18n.SetLocalizer(i18n.InitWithLocale(language))
6363
Expect(i18n.T("Recurring Price")).To(Equal(xlationMap[language]))
6464
})
65-
It("Testing "+language+" everything", func() {
66-
// If these fails as untranslated, try running ./bin/generate-i18n-resources.sh
67-
regex, _ := regexp.Compile("{{.([[:alnum:]])*}}")
68-
coreConfig.SetLocale(language)
69-
i18n.SetLocalizer(i18n.InitWithLocale(language))
70-
file, err := ioutil.ReadFile("resources/" + language + ".json")
71-
Expect(err).NotTo(HaveOccurred())
72-
xlations := []I18nXlation{}
73-
jsonErr := json.Unmarshal([]byte(file), &xlations)
74-
Expect(jsonErr).NotTo(HaveOccurred())
75-
for i := 0; i < len(xlations); i++ {
76-
subs := regex.ReplaceAllString(xlations[i].Translation, "<no value>")
77-
Expect(i18n.T(xlations[i].Id)).To(Equal(subs))
78-
}
79-
})
8065
}
8166
})
8267
})

0 commit comments

Comments
 (0)