2024-10-14 23:41:43 +02:00
|
|
|
import { OptionReminder, splitTime } from "../../../utils/commands/reminder";
|
2024-09-27 20:49:36 +02:00
|
|
|
|
2024-12-10 10:04:15 +01:00
|
|
|
import { describe, it } from "node:test";
|
|
|
|
import assert from "node:assert/strict";
|
|
|
|
|
2024-09-27 20:49:36 +02:00
|
|
|
describe("Time splitter", () => {
|
|
|
|
{
|
2024-12-10 10:21:56 +01:00
|
|
|
it("Empty String", () => {
|
|
|
|
assert.deepStrictEqual(splitTime(""), { option: OptionReminder.Nothing, time: "" });
|
2024-09-27 20:49:36 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
{
|
|
|
|
const name = "2m@p";
|
2024-12-10 10:04:15 +01:00
|
|
|
it(name, () => {
|
|
|
|
assert.deepStrictEqual(splitTime(name), { option: OptionReminder.DirectMessage, time: "2m" });
|
2024-09-27 20:49:36 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
{
|
|
|
|
const name = "41@";
|
2024-12-10 10:04:15 +01:00
|
|
|
it(name, () => {
|
|
|
|
assert.deepStrictEqual(splitTime(name), { option: OptionReminder.Mention, time: "41" });
|
2024-09-27 20:49:36 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
{
|
|
|
|
const name = "0P";
|
2024-12-10 10:04:15 +01:00
|
|
|
it(name, () => {
|
|
|
|
assert.deepStrictEqual(splitTime(name), { option: OptionReminder.DirectMessage, time: "0" });
|
2024-09-27 20:49:36 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|