-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix getting template by name not returning the associated id #362
Conversation
Signed-off-by: Kelly Deng <[email protected]>
ce621e2
to
57b0b1e
Compare
Codecov Report
@@ Coverage Diff @@
## master #362 +/- ##
=======================================
Coverage 24.74% 24.74%
=======================================
Files 14 14
Lines 1277 1277
=======================================
Hits 316 316
Misses 940 940
Partials 21 21
Continue to review full report at Codecov.
|
} | ||
if fields["name"] == templateName1 { | ||
return "", template1, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 2 if
statements can be combined as one.
@@ -58,8 +58,8 @@ func TestCreateWorkflow(t *testing.T) { | |||
"FailedCreatingWorkflow": { | |||
args: args{ | |||
db: mock.DB{ | |||
GetTemplateFunc: func(ctx context.Context, fields map[string]string) (string, string, error) { | |||
return "", templateData, nil | |||
GetTemplateFunc: func(ctx context.Context, fields map[string]string) (string, string, string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of returning an empty string, maybe we can return a pre-defined name for mock (e.g., MockedTemplate
?).
Description
Fetching a template by name now also returns the associated ID.
Why is this needed
A recent PR #349 added the functionality of fetching a template by name. The returned template is expected to include the ID, name, and template data. However, currently, it would only return the name and the template data. The returned ID is just an empty string.
How Has This Been Tested?
Manually
How are existing users impacted? What migration steps/scripts do we need?
Checklist:
I have: