1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-10-15 19:42:04 +00:00

Convert anonymous structs in ViewResponse into named structs for unit testing

This commit is contained in:
Mathieu Fenniak 2025-08-26 21:29:12 -06:00
parent 13142acf60
commit cb17e7542c

View file

@ -112,8 +112,16 @@ type ViewRequest struct {
} }
type ViewResponse struct { type ViewResponse struct {
State struct { State ViewState `json:"state"`
Run struct { Logs ViewLogs `json:"logs"`
}
type ViewState struct {
Run ViewRunInfo `json:"run"`
CurrentJob ViewCurrentJob `json:"currentJob"`
}
type ViewRunInfo struct {
Link string `json:"link"` Link string `json:"link"`
Title string `json:"title"` Title string `json:"title"`
TitleHTML template.HTML `json:"titleHTML"` TitleHTML template.HTML `json:"titleHTML"`
@ -125,16 +133,16 @@ type ViewResponse struct {
Done bool `json:"done"` Done bool `json:"done"`
Jobs []*ViewJob `json:"jobs"` Jobs []*ViewJob `json:"jobs"`
Commit ViewCommit `json:"commit"` Commit ViewCommit `json:"commit"`
} `json:"run"` }
CurrentJob struct {
type ViewCurrentJob struct {
Title string `json:"title"` Title string `json:"title"`
Detail string `json:"detail"` Detail string `json:"detail"`
Steps []*ViewJobStep `json:"steps"` Steps []*ViewJobStep `json:"steps"`
} `json:"currentJob"` }
} `json:"state"`
Logs struct { type ViewLogs struct {
StepsLog []*ViewStepLog `json:"stepsLog"` StepsLog []*ViewStepLog `json:"stepsLog"`
} `json:"logs"`
} }
type ViewJob struct { type ViewJob struct {