Skip to content

Commit 4b13ecf

Browse files
committed
add test
1 parent 9a0592a commit 4b13ecf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/integration/migrate_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,12 @@ func TestMigrateGiteaForm(t *testing.T) {
7979
resp := session.MakeRequest(t, req, http.StatusOK)
8080
// Step 2: load the form
8181
htmlDoc := NewHTMLParser(t, resp.Body)
82-
link, exists := htmlDoc.doc.Find(`form.ui.form[action^="/repo/migrate"]`).Attr("action")
82+
form := htmlDoc.doc.Find(`form.ui.form[action^="/repo/migrate"]`)
83+
link, exists := form.Attr("action")
8384
assert.True(t, exists, "The template has changed")
85+
serviceInput, exists := form.Find(`input[name="service"]`).Attr("value")
86+
assert.True(t, exists)
87+
assert.EqualValues(t, fmt.Sprintf("%d", structs.GiteaService), serviceInput)
8488
// Step 4: submit the migration to only migrate issues
8589
migratedRepoName := "otherrepo"
8690
req = NewRequestWithValues(t, "POST", link, map[string]string{

0 commit comments

Comments
 (0)