28 lines
739 B
TypeScript
28 lines
739 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.DirectMessage, 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" });
|
|
});
|
|
}
|
|
});
|