Update test to use edited task description
Modified the test in create_test.go to return and expect 'edited task description' instead of concatenating the prompt string. This clarifies the test's intent and expected behavior for the MarkdownEditorFunc and CreateJobFunc.
This commit is contained in:
parent
666f5574e4
commit
f22dc9271b
1 changed files with 2 additions and 2 deletions
|
|
@ -153,7 +153,7 @@ func Test_createRun(t *testing.T) {
|
|||
MarkdownEditorFunc: func(prompt, defaultValue string, blankAllowed bool) (string, error) {
|
||||
require.Equal(t, "Enter the task description", prompt)
|
||||
require.Equal(t, "task description from file", defaultValue)
|
||||
return prompt + "+From editor", nil
|
||||
return "edited task description", nil
|
||||
},
|
||||
ConfirmFunc: func(message string, defaultValue bool) (bool, error) {
|
||||
require.Equal(t, "Submit agent task", message)
|
||||
|
|
@ -166,7 +166,7 @@ func Test_createRun(t *testing.T) {
|
|||
m.CreateJobFunc = func(ctx context.Context, owner, repo, problemStatement, baseBranch string) (*capi.Job, error) {
|
||||
require.Equal(t, "OWNER", owner)
|
||||
require.Equal(t, "REPO", repo)
|
||||
require.Equal(t, "Enter the task description+From editor", problemStatement)
|
||||
require.Equal(t, "edited task description", problemStatement)
|
||||
return &createdJobSuccessWithPR, nil
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue