mirror of
https://gitdab.com/cadence/out-of-your-element.git
synced 2025-09-11 04:33:02 +02:00
Test invite interaction & code coverage
This commit is contained in:
parent
65170c1282
commit
bad8c5b8c2
15 changed files with 407 additions and 161 deletions
|
@ -1,5 +1,8 @@
|
|||
// @ts-check
|
||||
|
||||
const tryToCatch = require("try-to-catch")
|
||||
const {test} = require("supertape")
|
||||
const {reg} = require("./read-registration")
|
||||
const {reg, checkRegistration, getTemplateRegistration} = require("./read-registration")
|
||||
|
||||
test("reg: has necessary parameters", t => {
|
||||
const propertiesToCheck = ["sender_localpart", "id", "as_token", "ooye"]
|
||||
|
@ -8,3 +11,19 @@ test("reg: has necessary parameters", t => {
|
|||
propertiesToCheck
|
||||
)
|
||||
})
|
||||
|
||||
test("check: passes on sample", t => {
|
||||
checkRegistration(reg)
|
||||
t.pass("all assertions passed")
|
||||
})
|
||||
|
||||
test("check: fails on template as template is missing some required values that are gathered during setup", t => {
|
||||
let err
|
||||
try {
|
||||
// @ts-ignore
|
||||
checkRegistration(getTemplateRegistration("cadence.moe"))
|
||||
} catch (e) {
|
||||
err = e
|
||||
}
|
||||
t.ok(err, "one of the assertions failed as expected")
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue