Botanique/tests/utils/reminder.test.ts
Mylloon af8ba14b83
Some checks failed
PR Check / lint-and-format (pull_request) Failing after 15s
have to fix
2024-09-27 13:17:53 +02:00

28 lines
733 B
TypeScript

import { OptionReminder, splitTime } from "../../src/utils/reminder";
describe("Time splitter", () => {
{
const name = "";
test(name, () => {
expect(splitTime(name)).toStrictEqual({ option: OptionReminder.Nothing, time: "" });
});
}
{
const name = "2m@p";
test(name, () => {
expect(splitTime(name)).toStrictEqual({ option: OptionReminder.Mention, time: "2m" });
});
}
{
const name = "41@";
test(name, () => {
expect(splitTime(name)).toStrictEqual({ option: OptionReminder.Mention, time: "41" });
});
}
{
const name = "0P";
test(name, () => {
expect(splitTime(name)).toStrictEqual({ option: OptionReminder.DirectMessage, time: "0" });
});
}
});