Botanique/tests/utils/reminder.test.ts

29 lines
739 B
TypeScript
Raw Normal View History

2024-09-27 12:55:06 +02:00
import { OptionReminder, splitTime } from "../../src/utils/reminder";
describe("Time splitter", () => {
{
const name = "";
test(name, () => {
expect(splitTime(name)).toStrictEqual({ option: OptionReminder.Nothing, time: "" });
});
}
2024-09-27 13:17:53 +02:00
{
2024-09-27 12:55:06 +02:00
const name = "2m@p";
test(name, () => {
2024-09-27 14:36:05 +02:00
expect(splitTime(name)).toStrictEqual({ option: OptionReminder.DirectMessage, time: "2m" });
2024-09-27 12:55:06 +02:00
});
2024-09-27 13:17:53 +02:00
}
2024-09-27 12:55:06 +02:00
{
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" });
});
}
});