Commit b16ebf49 authored by Sietse Ringers's avatar Sietse Ringers
Browse files

feat: remove double wizard name from wizard validation error messages

parent 66219933
......@@ -367,11 +367,11 @@ func (wizard *IssueWizard) Validate(conf *Configuration) error {
}
if len(result) >= maxWizardComplexity {
return errors.Errorf("wizard with wizard ID %s too complex", wizard.ID)
return errors.New("wizard too complex")
}
} else {
if len(contents) >= maxWizardComplexity {
return errors.Errorf("wizard with wizard ID %s too complex", wizard.ID)
return errors.New("wizard too complex")
}
}
}
......@@ -385,19 +385,19 @@ func (wizard *IssueWizard) Validate(conf *Configuration) error {
if item.Credential == nil {
shouldBeLast = true
} else if shouldBeLast {
return errors.Errorf("items having no credential type in wizard %s should come last", wizard.ID)
return errors.New("items having no credential type should come last")
}
if err := item.validate(conf); err != nil {
return errors.Errorf("item %d.%d.%d of issue wizard %s: %w", i, j, k, wizard.ID, err)
return errors.Errorf("item %d.%d.%d: %w", i, j, k, err)
}
conf.validateTranslations(fmt.Sprintf("item %d.%d.%d of issue wizard %s", i, j, k, wizard.ID), item)
conf.validateTranslations(fmt.Sprintf("item %d.%d.%d", i, j, k), item)
}
}
}
conf.validateTranslations(fmt.Sprintf("issue wizard %s", wizard.ID), wizard)
conf.validateTranslations("issue wizard", wizard)
for i, qa := range wizard.FAQ {
conf.validateTranslations(fmt.Sprintf("QA %d of issue wizard %s", i, wizard.ID), qa)
conf.validateTranslations(fmt.Sprintf("QA %d", i), qa)
}
return nil
......
......@@ -1085,7 +1085,7 @@ func TestWizardIncorrectContentsOrder(t *testing.T) {
}
err := wizard.Validate(conf)
require.EqualError(t, err, "items having no credential type in wizard testwizard should come last")
require.EqualError(t, err, "items having no credential type should come last")
}
func TestWizardComplexity(t *testing.T) {
......@@ -1160,7 +1160,7 @@ func TestWizardComplexity(t *testing.T) {
}
err := wizard.Validate(conf)
require.EqualError(t, err, "wizard with wizard ID testwizard too complex")
require.EqualError(t, err, "wizard too complex")
}
func TestIssueWizardItemValidation(t *testing.T) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment