Commit b7809918 by Emil Tullstedt Committed by GitHub

Dashboard: Update tests for testing fallback support (#23730)

parent df60dbd7
...@@ -29,10 +29,20 @@ func TestDashboardModel(t *testing.T) { ...@@ -29,10 +29,20 @@ func TestDashboardModel(t *testing.T) {
So(dashboard.Slug, ShouldEqual, "grafana-play-home") So(dashboard.Slug, ShouldEqual, "grafana-play-home")
}) })
Convey("Can slugify title", t, func() { Convey("Can slugify titles", t, func() {
slug := SlugifyTitle("Grafana Play Home") tests := map[string]string{
"Grafana Play Home": "grafana-play-home",
So(slug, ShouldEqual, "grafana-play-home") "snöräv-över-ån": "snorav-over-an",
"漢字": "han-zi", // Hanzi for hanzi
"🇦🇶": "8J-HpvCfh7Y", // flag of Antarctica-emoji, using fallback
"𒆠": "8JKGoA", // cuneiform Ki, using fallback
}
for input, expected := range tests {
slug := SlugifyTitle(input)
So(slug, ShouldEqual, expected)
}
}) })
Convey("Given a dashboard json", t, func() { Convey("Given a dashboard json", t, func() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment