Fix tests

This commit is contained in:
Bohdan Horbeshko 2026-08-22 17:57:14 -04:00
parent 22cb5b3d4c
commit 930557bda5
3 changed files with 16 additions and 13 deletions

View file

@ -64,6 +64,7 @@ func TestSessionToMap(t *testing.T) {
"receipts": "true",
"nativeedits": "false",
"ignoregroupdeletions": "false",
"omemo": "auto",
}
if !reflect.DeepEqual(m, sample) {
t.Errorf("Map does not match the sample: %v", m)

View file

@ -604,7 +604,7 @@ func TestUsernameMention(t *testing.T) {
Type: &client.TextEntityTypeMention{},
},
}, MarkupModeXEP0393, &MentionRetrieverMock{})
if markup != "a b c" {
if markup != "a @b c" {
t.Errorf("Wrong mention formatting: %v", markup)
}
}
@ -617,7 +617,7 @@ func TestUsernameMentionName(t *testing.T) {
Type: &client.TextEntityTypeMentionName{UserId: 100500},
},
}, MarkupModeXEP0393, &MentionRetrieverMock{})
if markup != "a 42 c" {
if markup != "a @42 c" {
t.Errorf("Wrong mention name formatting: %v", markup)
}
}
@ -635,7 +635,7 @@ func TestUsernameMentionNested(t *testing.T) {
Type: &client.TextEntityTypeBold{},
},
}, MarkupModeXEP0393, &MentionRetrieverMock{})
if markup != "a b c" {
if markup != "a @b c" {
t.Errorf("Wrong formatting of mention with nested entity: %v", markup)
}
}
@ -653,7 +653,7 @@ func TestUsernameMentionNestedEven(t *testing.T) {
Type: &client.TextEntityTypeBold{},
},
}, MarkupModeXEP0393, &MentionRetrieverMock{})
if markup != "a *b* c" {
if markup != "a *@b* c" {
t.Errorf("Wrong formatting of mention with even nested entity: %v", markup)
}
}

View file

@ -97,7 +97,8 @@ func TestDiscoVerPsi(t *testing.T) {
{Var: "http://jabber.org/protocol/muc"},
{Var: "http://jabber.org/protocol/caps"},
},
Form: &stanza.Form{
Forms: []*stanza.Form{
{
Type: "result",
Fields: []*stanza.Field{
{Var: "FORM_TYPE", Type: "hidden", ValuesList: []string{"urn:xmpp:dataforms:softwareinfo"}},
@ -108,6 +109,7 @@ func TestDiscoVerPsi(t *testing.T) {
{Var: "software_version", ValuesList: []string{"0.11"}},
},
},
},
}
testDiscoVer(t, &disco, "MxdZjNKNku1+SiM9N92yqIK2HTQ=")
}