mobilizon-event-importer/scrapers/facebook.com/facebook_test.go
2022-04-04 17:33:21 +02:00

21 lines
670 B
Go

package facebook
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestNormalizeEventID(t *testing.T) {
tests := map[string]string{
" ": " ",
"https://www.facebook.com/events/415721506974513": "415721506974513",
"https://www.facebook.com/events/415721506974513/": "415721506974513",
"https://www.facebook.com/events/415721506974513/?ref=asdf": "415721506974513",
"415721506974513/?ref=asdf": "415721506974513",
"415721506974513": "415721506974513",
}
for in, expected := range tests {
assert.Equal(t, expected, NormalizeEventID(in), in)
}
}