Verify multimodal content boundaries and every material sort
This commit is contained in:
@@ -168,6 +168,21 @@ func TestOnboardingAndSharing(t *testing.T) {
|
||||
call("DELETE", workspacePath+"/tags/"+tag["id"].(string), tokens[0], nil, 204)
|
||||
call("PATCH", textPath, tokens[0], changed, 412, `"3"`)
|
||||
|
||||
imageContent := response{"image": response{"url": "https://assets.example.com/image.png", "alt": "Photo"}}
|
||||
call("POST", workspacePath+"/materials", tokens[0], response{"kind": "image", "title": "Photo", "content": imageContent}, 201)
|
||||
call("POST", workspacePath+"/materials", tokens[0], response{"kind": "card", "title": "Mixed card", "content": response{"parts": []any{
|
||||
response{"kind": "text", "text": "Caption"},
|
||||
response{"kind": "article", "article": articleContent["article"]},
|
||||
response{"kind": "image", "image": imageContent["image"]},
|
||||
}}}, 201)
|
||||
for _, sort := range []string{"modified", "created", "alphabetical", "opened", "tag"} {
|
||||
call("GET", workspacePath+"/materials?sort="+sort+"&limit=2", tokens[0], nil, 200)
|
||||
}
|
||||
images := call("GET", workspacePath+"/materials?kind=image&q=Photo", tokens[0], nil, 200)
|
||||
if len(images["items"].([]any)) != 1 {
|
||||
t.Fatal("kind/title filter returned incorrect materials")
|
||||
}
|
||||
|
||||
email := "fixture@example.invalid"
|
||||
password := "a-long-fixture-password"
|
||||
call("POST", base+"/auth/register", "", response{"email": email, "password": password}, 202)
|
||||
|
||||
Reference in New Issue
Block a user