Integrate graphics, RAW, audio and CAD Craft tools with protected saves

This commit is contained in:
SantaSpeen committed 2026-10-22 19:48:16 +03:00
1 parent 6e36b6c4b7
commit 852140c3a7
24 files changed
+600 -74

No files matched your search

+8 -3
View File
@@ -26,7 +26,8 @@ import (
func installedTestManager(t *testing.T) *addons.Manager {
t.Helper()
root := t.TempDir()
for _, id := range []string{"wordcraft", "gridcraft", "deckcraft", "pdfcraft"} {
for _, tool := range addons.Catalog {
id := tool.ID
dir := filepath.Join(root, id, "versions", "test-123")
if err := os.MkdirAll(dir, 0750); err != nil {
t.Fatal(err)
@@ -209,7 +210,11 @@ func TestOfficeBridgeDelivery(t *testing.T) {
perm := users.Permissions{Download: true, Modify: true}
store := scopedUserStorage(t, root, perm, key)
handler := handle(addonStaticHandler(manager), "", store, &settings.Server{})
for _, id := range []string{"wordcraft", "deckcraft"} {
for _, tool := range addons.Catalog {
id := tool.ID
if !needsOfficeBridge(id) {
continue
}
index := filepath.Join(manager.Root, id, "versions", "test-123", "index.html")
original := []byte("<html><head></head><body>vendor</body></html>")
if err := os.WriteFile(index, original, 0600); err != nil {
@@ -227,7 +232,7 @@ func TestOfficeBridgeDelivery(t *testing.T) {
if name == "index.html" && !strings.Contains(rec.Body.String(), `src="./filebrowser-bridge.js"`) {
t.Fatal("missing adapter")
}
if name != "index.html" && !bytes.Equal(rec.Body.Bytes(), officeBridge) {
if name != "index.html" && !bytes.Contains(rec.Body.Bytes(), officeBridge) {
t.Fatal("wrong bridge")
}
}