Library Panels: Add name endpoint & unique name validation to AddLibraryPanelModal (#33987)
This commit is contained in:
@@ -110,6 +110,10 @@ type libraryElementResult struct {
|
||||
Result libraryElement `json:"result"`
|
||||
}
|
||||
|
||||
type libraryElementArrayResult struct {
|
||||
Result []libraryElement `json:"result"`
|
||||
}
|
||||
|
||||
type libraryElementsSearch struct {
|
||||
Result libraryElementsSearchResult `json:"result"`
|
||||
}
|
||||
@@ -248,6 +252,17 @@ func validateAndUnMarshalResponse(t *testing.T, resp response.Response) libraryE
|
||||
return result
|
||||
}
|
||||
|
||||
func validateAndUnMarshalArrayResponse(t *testing.T, resp response.Response) libraryElementArrayResult {
|
||||
t.Helper()
|
||||
|
||||
require.Equal(t, 200, resp.Status())
|
||||
var result = libraryElementArrayResult{}
|
||||
err := json.Unmarshal(resp.Body(), &result)
|
||||
require.NoError(t, err)
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
func scenarioWithPanel(t *testing.T, desc string, fn func(t *testing.T, sc scenarioContext)) {
|
||||
t.Helper()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user