fix: sync websocket and WebK compatibility fixes
This commit is contained in:
parent
ea6cc72886
commit
1f646ef024
11 changed files with 311 additions and 17 deletions
|
|
@ -40,6 +40,7 @@ func TestAppConfigIncludesStoryStealthPeriods(t *testing.T) {
|
|||
}
|
||||
values := make(map[string]float64)
|
||||
strings := make(map[string]string)
|
||||
arrays := make(map[string]*tg.JSONArray)
|
||||
if object, ok := got.Config.(*tg.JSONObject); ok && object != nil {
|
||||
for _, entry := range object.Value {
|
||||
if number, ok := entry.Value.(*tg.JSONNumber); ok {
|
||||
|
|
@ -48,6 +49,9 @@ func TestAppConfigIncludesStoryStealthPeriods(t *testing.T) {
|
|||
if str, ok := entry.Value.(*tg.JSONString); ok {
|
||||
strings[entry.Key] = str.Value
|
||||
}
|
||||
if array, ok := entry.Value.(*tg.JSONArray); ok {
|
||||
arrays[entry.Key] = array
|
||||
}
|
||||
}
|
||||
}
|
||||
want := map[string]float64{
|
||||
|
|
@ -63,9 +67,20 @@ func TestAppConfigIncludesStoryStealthPeriods(t *testing.T) {
|
|||
if strings["rich_message_posting"] != "enabled" {
|
||||
t.Fatalf("AppConfig[rich_message_posting] = %q, want enabled", strings["rich_message_posting"])
|
||||
}
|
||||
fragmentPrefixes := arrays["fragment_prefixes"]
|
||||
if fragmentPrefixes == nil || len(fragmentPrefixes.Value) != 1 {
|
||||
t.Fatalf("AppConfig[fragment_prefixes] = %#v, want one-element array", fragmentPrefixes)
|
||||
}
|
||||
prefix, ok := fragmentPrefixes.Value[0].(*tg.JSONString)
|
||||
if !ok || prefix.Value != "888" {
|
||||
t.Fatalf("AppConfig[fragment_prefixes][0] = %#v, want \"888\"", fragmentPrefixes.Value[0])
|
||||
}
|
||||
if _, ok := AppConfig(got.Hash).(*tg.HelpAppConfigNotModified); !ok {
|
||||
t.Fatalf("AppConfig(hash) = %#v, want notModified", AppConfig(got.Hash))
|
||||
}
|
||||
if _, ok := AppConfig(got.Hash - 1).(*tg.HelpAppConfig); !ok {
|
||||
t.Fatalf("AppConfig(old hash) = %#v, want refreshed config", AppConfig(got.Hash-1))
|
||||
}
|
||||
}
|
||||
|
||||
func TestFallbackAppConfigOmitsMapboxToken(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue