summaryrefslogtreecommitdiffstats
path: root/bridge/matrix/matrix_test.go
blob: 846d9a431490e0be415e22bca4906dbbc1cd0ca5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package bmatrix

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestPlainUsername(t *testing.T) {
	uut := newMatrixUsername("MyUser")

	assert.Equal(t, "MyUser", uut.formatted)
	assert.Equal(t, "MyUser", uut.plain)
}

func TestHTMLUsername(t *testing.T) {
	uut := newMatrixUsername("<b>MyUser</b>")

	assert.Equal(t, "<b>MyUser</b>", uut.formatted)
	assert.Equal(t, "MyUser", uut.plain)
}

func TestFancyUsername(t *testing.T) {
	uut := newMatrixUsername("<MyUser>")

	assert.Equal(t, "&lt;MyUser&gt;", uut.formatted)
	assert.Equal(t, "<MyUser>", uut.plain)
}