Remove nuxt + 100 other things..
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
package unit
|
||||
|
||||
import be.vandewalleh.markdown.Markdown
|
||||
import be.vandewalleh.markdown.Meta
|
||||
import org.amshove.kluent.*
|
||||
import org.junit.jupiter.api.*
|
||||
|
||||
class MarkdownTest {
|
||||
|
||||
@Test
|
||||
fun a() {
|
||||
val md = Markdown()
|
||||
fun Markdown.convertTrim(input: String) = convertToMarkdown(input).trim()
|
||||
|
||||
md.convertTrim("# title") `should be equal to` "<h1>title</h1>"
|
||||
|
||||
md.convertTrim(
|
||||
"""
|
||||
|- 1
|
||||
|- 2
|
||||
|- 3
|
||||
""".trimMargin()
|
||||
) `should be equal to`
|
||||
"""
|
||||
|<ul>
|
||||
|<li>1</li>
|
||||
|<li>2</li>
|
||||
|<li>3</li>
|
||||
|</ul>
|
||||
""".trimMargin()
|
||||
|
||||
// md.parseMeta("title: test") `should be equal to` Meta("test")
|
||||
|
||||
md.parseMeta(
|
||||
"""
|
||||
|title: test
|
||||
|tags:
|
||||
| - a
|
||||
| - b
|
||||
|""".trimMargin()
|
||||
) `should be equal to`
|
||||
Meta("test", listOf("a", "b"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testMeta() {
|
||||
val md = Markdown()
|
||||
val out = md.renderDocument(
|
||||
"""
|
||||
|
|
||||
|---
|
||||
|
|
||||
|title: test
|
||||
|tags: [a,b]
|
||||
|---
|
||||
|
|
||||
|# Title
|
||||
|
|
||||
|- a
|
||||
|- b
|
||||
""".trimMargin()
|
||||
)
|
||||
|
||||
println(out)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package unit.validation
|
||||
|
||||
import be.vandewalleh.entities.User
|
||||
import be.vandewalleh.validation.registerValidator
|
||||
import org.amshove.kluent.*
|
||||
import org.junit.jupiter.api.*
|
||||
import utils.firstInvalid
|
||||
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
class RegisterValidationTest {
|
||||
|
||||
@Test
|
||||
fun `valid register test`() {
|
||||
val violations = registerValidator.validate(
|
||||
User {
|
||||
username = "hubert"
|
||||
password = "definitelyNotMyPassword"
|
||||
}
|
||||
)
|
||||
|
||||
violations.isValid `should be equal to` true
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `username too long test`() {
|
||||
val violations = registerValidator.validate(
|
||||
User {
|
||||
username = "6X9iboWmEOWjVjkO328ReTJ1gGPTTmB/ZGgBLhB6EzAJoWkJht8"
|
||||
password = "definitelyNotMyPassword"
|
||||
}
|
||||
)
|
||||
|
||||
violations.isValid `should be equal to` false
|
||||
violations.firstInvalid `should be equal to` "username"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user