fix(support-chat): simplify legacy mobile styles
This commit is contained in:
@@ -165,15 +165,30 @@ func TestSupportChatKeepsOlderMobileWebViewsCompatible(t *testing.T) {
|
||||
t.Fatalf("read support chat stylesheet: %v", err)
|
||||
}
|
||||
css := string(stylesheet)
|
||||
for _, fallback := range []string{
|
||||
`background: linear-gradient(145deg, #3c80fb, #4c66ea);`,
|
||||
`background: linear-gradient(135deg, #397ffb, #5368ed);`,
|
||||
`background: #eaf2ff;`,
|
||||
`top: 0; right: 0; bottom: 0; left: 0; inset: 0;`,
|
||||
`width: 100%; max-width: 360px; width: min(100%, 360px);`,
|
||||
for _, forbidden := range []string{
|
||||
`color-mix(`,
|
||||
`height: 100dvh`,
|
||||
`inset:`,
|
||||
`width: min(`,
|
||||
`top: max(`,
|
||||
`backdrop-filter`,
|
||||
`place-items`,
|
||||
`overflow-wrap: anywhere`,
|
||||
} {
|
||||
if !strings.Contains(css, fallback) {
|
||||
t.Fatalf("support chat stylesheet does not contain older mobile fallback %q", fallback)
|
||||
if strings.Contains(css, forbidden) {
|
||||
t.Fatalf("support chat stylesheet must not require newer mobile CSS %q", forbidden)
|
||||
}
|
||||
}
|
||||
for _, marker := range []string{
|
||||
`.message-row.mine .message-bubble { border-color: #2475fc;`,
|
||||
`.send-button { width: 40px; height: 40px;`,
|
||||
`color: #fff; background: #2475fc;`,
|
||||
`background: #eaf2ff;`,
|
||||
`top: 0; right: 0; bottom: 0; left: 0;`,
|
||||
`width: 100%; max-width: 360px;`,
|
||||
} {
|
||||
if !strings.Contains(css, marker) {
|
||||
t.Fatalf("support chat stylesheet does not contain basic mobile CSS %q", marker)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user