test(systemviews): cover config API routing
- commit
- c23bc352d19cad072e63d4b795fba9af3787ad5c
- author
- brice · · 2026-04-24 01:51 UTC
- parent
- 98c5923
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
1 file · +13 -2
M internal/infrastructure/cef/internal_urls_test.go +13 -2
| @@ -43,6 +43,11 @@ func TestToActualInternalURL(t *testing.T) { | |||
| 43 | 43 | in: "dumb://history/api/message", | |
| 44 | 44 | want: "https://dumber.invalid/api/message", | |
| 45 | 45 | }, | |
| 46 | + | { | |
| 47 | + | name: "config api path stays at origin root", | |
| 48 | + | in: "dumb://config/api/config/default", | |
| 49 | + | want: "https://dumber.invalid/api/config/default", | |
| 50 | + | }, | |
| 46 | 51 | { | |
| 47 | 52 | name: "root asset stays at origin root", | |
| 48 | 53 | in: "dumb://history/favicon.ico", | |
| @@ -92,11 +97,17 @@ func TestResolveAPIPath(t *testing.T) { | |||
| 92 | 97 | ok: true, | |
| 93 | 98 | }, | |
| 94 | 99 | { | |
| 95 | - | name: "conceptual page api path", | |
| 96 | - | in: "dumb://home/api/message", | |
| 100 | + | name: "conceptual history api path", | |
| 101 | + | in: "dumb://history/api/message", | |
| 97 | 102 | want: "/api/message", | |
| 98 | 103 | ok: true, | |
| 99 | 104 | }, | |
| 105 | + | { | |
| 106 | + | name: "conceptual config api path", | |
| 107 | + | in: "dumb://config/api/config/default", | |
| 108 | + | want: "/api/config/default", | |
| 109 | + | ok: true, | |
| 110 | + | }, | |
| 100 | 111 | { | |
| 101 | 112 | name: "actual internal api path", | |
| 102 | 113 | in: "https://dumber.invalid/api/focus-sync", | |
| @@ -43,6 +43,11 @@ func TestToActualInternalURL(t *testing.T) { | |||||
| 43 | in: "dumb://history/api/message", | 43 | in: "dumb://history/api/message", | ||
| 44 | want: "https://dumber.invalid/api/message", | 44 | want: "https://dumber.invalid/api/message", | ||
| 45 | }, | 45 | }, | ||
| 46 | + | { | |||
| 47 | + | name: "config api path stays at origin root", | |||
| 48 | + | in: "dumb://config/api/config/default", | |||
| 49 | + | want: "https://dumber.invalid/api/config/default", | |||
| 50 | + | }, | |||
| 46 | { | 51 | { | ||
| 47 | name: "root asset stays at origin root", | 52 | name: "root asset stays at origin root", | ||
| 48 | in: "dumb://history/favicon.ico", | 53 | in: "dumb://history/favicon.ico", | ||
| @@ -92,11 +97,17 @@ func TestResolveAPIPath(t *testing.T) { | |||||
| 92 | ok: true, | 97 | ok: true, | ||
| 93 | }, | 98 | }, | ||
| 94 | { | 99 | { | ||
| 95 | - | name: "conceptual page api path", | 100 | + | name: "conceptual history api path", |
| 96 | - | in: "dumb://home/api/message", | 101 | + | in: "dumb://history/api/message", |
| 97 | want: "/api/message", | 102 | want: "/api/message", | ||
| 98 | ok: true, | 103 | ok: true, | ||
| 99 | }, | 104 | }, | ||
| 105 | + | { | |||
| 106 | + | name: "conceptual config api path", | |||
| 107 | + | in: "dumb://config/api/config/default", | |||
| 108 | + | want: "/api/config/default", | |||
| 109 | + | ok: true, | |||
| 110 | + | }, | |||
| 100 | { | 111 | { | ||
| 101 | name: "actual internal api path", | 112 | name: "actual internal api path", | ||
| 102 | in: "https://dumber.invalid/api/focus-sync", | 113 | in: "https://dumber.invalid/api/focus-sync", | ||