feat(feeds): add optional sandboxed in-tab article preview
This commit is contained in:
1 parent
ea1ca432c5
commit
f4869c7c8b
10 files changed
+68
-5
No files matched your search
@@ -1,11 +1,32 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestRSSLinkPreference(t *testing.T) {
|
||||
s, token, domain, actor, _ := feedFixture(t)
|
||||
p, err := s.store.TaskPreferences(context.Background(), domain, actor)
|
||||
if err != nil || p.RSSLinkMode != "tab" {
|
||||
t.Fatal(p.RSSLinkMode, err)
|
||||
}
|
||||
p.RSSLinkMode = "embedded"
|
||||
if w := taskRequest(s, token, "PUT", "preferences", p, ""); w.Code != 200 {
|
||||
t.Fatal(w.Code, w.Body)
|
||||
}
|
||||
p, err = s.store.TaskPreferences(context.Background(), domain, actor)
|
||||
if err != nil || p.RSSLinkMode != "embedded" {
|
||||
t.Fatal(p.RSSLinkMode, err)
|
||||
}
|
||||
p.RSSLinkMode = "unsafe"
|
||||
if w := taskRequest(s, token, "PUT", "preferences", p, ""); w.Code != 422 {
|
||||
t.Fatal(w.Code, w.Body)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFeedCapturePreview(t *testing.T) {
|
||||
s, token, _, _, _ := feedFixture(t)
|
||||
for _, tt := range []struct {
|
||||
|
||||
Reference in new issue
Block a user