Improve code coverage
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// @ts-check
|
||||
|
||||
const {test} = require("supertape")
|
||||
const {eventSenderIsFromDiscord} = require("./utils")
|
||||
const {eventSenderIsFromDiscord, getEventIDHash} = require("./utils")
|
||||
|
||||
test("sender type: matrix user", t => {
|
||||
t.notOk(eventSenderIsFromDiscord("@cadence:cadence.moe"))
|
||||
@@ -14,3 +14,12 @@ test("sender type: ooye bot", t => {
|
||||
test("sender type: ooye puppet", t => {
|
||||
t.ok(eventSenderIsFromDiscord("@_ooye_sheep:cadence.moe"))
|
||||
})
|
||||
|
||||
test("event hash: hash is the same each time", t => {
|
||||
const eventID = "$example"
|
||||
t.equal(getEventIDHash(eventID), getEventIDHash(eventID))
|
||||
})
|
||||
|
||||
test("event hash: hash is different for different inputs", t => {
|
||||
t.notEqual(getEventIDHash("$Ij3qo7NxMA4VPexlAiIx2CB9JbsiGhJeyt-2OvkAUe1"), getEventIDHash("$Ij3qo7NxMA4VPexlAiIx2CB9JbsiGhJeyt-2OvkAUe2"))
|
||||
})
|
||||
|
Reference in New Issue
Block a user