// Copyright 2026 The Gitea Authors. All rights reserved. // SPDX-License-Identifier: MIT package markup import ( "strings" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestRenderIFrame(t *testing.T) { ctx := NewRenderContext(t.Context()). WithRelativePath("tree-path"). WithMetas(map[string]string{"user": "test-owner", "repo": "test-repo", "RefTypeNameSubURL": "src/branch/master"}) // iframe doesn't need sandbox, the sandbox is set in render's response header sb := &strings.Builder{} require.NoError(t, RenderIFrame(ctx, &ExternalRendererOptions{ContentSandbox: "any"}, sb)) assert.Equal(t, ``, sb.String()) }