@@ -34,6 +34,7 @@ func TestSlidesCreateBasic(t *testing.T) {
3434 "data" : map [string ]interface {}{
3535 "xml_presentation_id" : "pres_abc123" ,
3636 "revision_id" : 1 ,
37+ "url" : "https://tenant.example.com/slides/pres_abc123" ,
3738 },
3839 },
3940 })
@@ -54,10 +55,8 @@ func TestSlidesCreateBasic(t *testing.T) {
5455 if data ["title" ] != "项目汇报" {
5556 t .Fatalf ("title = %v, want 项目汇报" , data ["title" ])
5657 }
57- // URL is built locally from the token (brand-standard host), not fetched from
58- // drive metas, so it is deterministic and needs no drive scope.
59- if data ["url" ] != "https://www.feishu.cn/slides/pres_abc123" {
60- t .Fatalf ("url = %v, want https://www.feishu.cn/slides/pres_abc123" , data ["url" ])
58+ if data ["url" ] != "https://tenant.example.com/slides/pres_abc123" {
59+ t .Fatalf ("url = %v, want https://tenant.example.com/slides/pres_abc123" , data ["url" ])
6160 }
6261 if _ , ok := data ["permission_grant" ]; ok {
6362 t .Fatalf ("did not expect permission_grant in user mode" )
@@ -647,12 +646,12 @@ func TestSlidesCreateWithoutSlidesUnchanged(t *testing.T) {
647646 }
648647}
649648
650- // TestSlidesCreateURLBuiltLocally verifies the presentation URL is constructed
651- // locally from the token — no drive metas/batch_query call is made, so creation
652- // works for users who only authorized slides scopes. The httpmock registry has no
653- // batch_query stub registered; if the shortcut tried to call it, the request would
654- // fail the test (unregistered stub), proving the URL is built without a drive call .
655- func TestSlidesCreateURLBuiltLocally (t * testing.T ) {
649+ // TestSlidesCreateURLFallsBackToLocalBuild verifies the presentation URL is
650+ // constructed locally from the token when presentation.create omits url — no
651+ // drive metas/batch_query call is made, so creation works for users who only
652+ // authorized slides scopes. The httpmock registry has no batch_query stub
653+ // registered; if the shortcut tried to call it, the request would fail the test .
654+ func TestSlidesCreateURLFallsBackToLocalBuild (t * testing.T ) {
656655 t .Parallel ()
657656
658657 f , stdout , _ , reg := cmdutil .TestFactory (t , slidesTestConfig (t , "" ))
@@ -665,6 +664,7 @@ func TestSlidesCreateURLBuiltLocally(t *testing.T) {
665664 "data" : map [string ]interface {}{
666665 "xml_presentation_id" : "pres_local_url" ,
667666 "revision_id" : 1 ,
667+ "url" : "" ,
668668 },
669669 },
670670 })
0 commit comments