-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[backend:test] Add simple tests for emoji rendering
- Loading branch information
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
backend/src/test/scala/io/github/nwtgck/gh_card/emoji/EmojiRendererSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package io.github.nwtgck.gh_card.emoji | ||
|
||
import org.scalatest.{FunSpec, Matchers} | ||
|
||
class EmojiRendererSpec extends FunSpec with Matchers { | ||
describe("EmojiRendererSpec") { | ||
it("should render") { | ||
val actual = EmojiRenderer.render("hello :tada: world") | ||
val expect = "hello 🎉 world" | ||
actual shouldBe expect | ||
} | ||
it("should render with many spaces") { | ||
val actual = EmojiRenderer.render("hello :tada: world") | ||
val expect = "hello 🎉 world" | ||
actual shouldBe expect | ||
} | ||
it("should render with space/tab mixed") { | ||
val actual = EmojiRenderer.render("hello :tada:\tworld") | ||
val expect = "hello 🎉\tworld" | ||
actual shouldBe expect | ||
} | ||
} | ||
} |