init
This commit is contained in:
25
frontend_config_test.go
Normal file
25
frontend_config_test.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestFrontendDoesNotExposeCredentialKeyInput(t *testing.T) {
|
||||
source, err := os.ReadFile("frontend/src/App.tsx")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
app := string(source)
|
||||
|
||||
forbidden := []string{
|
||||
"<span>凭据键</span>",
|
||||
"next.gitea.credentialKey = event.target.value",
|
||||
}
|
||||
for _, text := range forbidden {
|
||||
if strings.Contains(app, text) {
|
||||
t.Fatalf("App.tsx should not expose editable credential key UI, found %q", text)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user