fix(support-chat): remove device verification prompt
This commit is contained in:
@@ -160,20 +160,20 @@ func TestSupportChatStagesUploadsUntilExplicitSend(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestSupportChatRequiresCurrentVerifiedNumberSession(t *testing.T) {
|
||||
func TestSupportChatEstablishesNumberSessionWithoutVerificationDialog(t *testing.T) {
|
||||
index, err := assets.ReadFile("assets/index.html")
|
||||
if err != nil {
|
||||
t.Fatalf("read support chat index: %v", err)
|
||||
}
|
||||
for _, marker := range []string{
|
||||
for _, forbidden := range []string{
|
||||
`id="access-overlay"`,
|
||||
`id="access-password-tab"`,
|
||||
`id="access-sms-tab"`,
|
||||
`id="access-send-code"`,
|
||||
`id="access-submit"`,
|
||||
} {
|
||||
if !strings.Contains(string(index), marker) {
|
||||
t.Fatalf("support chat verification dialog does not contain %q", marker)
|
||||
if strings.Contains(string(index), forbidden) {
|
||||
t.Fatalf("support chat must not contain verification dialog marker %q", forbidden)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,10 +184,7 @@ func TestSupportChatRequiresCurrentVerifiedNumberSession(t *testing.T) {
|
||||
source := string(script)
|
||||
for _, marker := range []string{
|
||||
`new URLSearchParams(window.location.hash.replace(/^#/, ""))`,
|
||||
`h5AccessRequest("/access/send-code"`,
|
||||
`h5AccessRequest("/access/authorize"`,
|
||||
`h5AccessRequest("/access/chat-entry"`,
|
||||
`"X-H5-Access-Token": accessToken`,
|
||||
`headers.set("X-H5-Chat-Session", "required")`,
|
||||
`headers.set("X-H5-Chat-Binding", state.chatBinding)`,
|
||||
`query.set("h5_chat_session", "required")`,
|
||||
@@ -201,6 +198,10 @@ func TestSupportChatRequiresCurrentVerifiedNumberSession(t *testing.T) {
|
||||
}
|
||||
}
|
||||
for _, forbidden := range []string{
|
||||
`h5AccessRequest("/access/send-code"`,
|
||||
`h5AccessRequest("/access/authorize"`,
|
||||
`"X-H5-Access-Token": accessToken`,
|
||||
`showAccessDialog(`,
|
||||
`localStorage.setItem("h5_access_token"`,
|
||||
`sessionStorage.setItem("h5_access_token"`,
|
||||
} {
|
||||
|
||||
Reference in New Issue
Block a user