mirror of
https://github.com/hanzoai/calendar.git
synced 2026-10-30 14:46:43 +00:00
* feat: Sink url shortner for sms workflow reminders * fix: remove hardcoded dub values * update .env.example * fix: unit tests * chore: add tests for scheduleSmsReminder and utils * review refactor * fix: type check * review refactor * fix: update test to account for smsReminderNumber fallback from main Co-Authored-By: unknown <> * feat: add feature flag for sink and more tests to verify * fix: type check * use proper feature flags for sink * Apply suggestion from @keithwillcode --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Keith Williams <[email protected]>
40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { NoopShortener } from "../providers/NoopShortener";
|
|
|
|
describe("NoopShortener", () => {
|
|
it("returns original URLs unchanged", async () => {
|
|
const shortener = new NoopShortener();
|
|
|
|
const result = await shortener.shortenMany(["https://example1.com", "https://example2.com"]);
|
|
|
|
expect(result).toEqual([{ shortLink: "https://example1.com" }, { shortLink: "https://example2.com" }]);
|
|
});
|
|
|
|
it("handles empty array", async () => {
|
|
const shortener = new NoopShortener();
|
|
|
|
const result = await shortener.shortenMany([]);
|
|
|
|
expect(result).toEqual([]);
|
|
});
|
|
|
|
it("handles empty strings", async () => {
|
|
const shortener = new NoopShortener();
|
|
|
|
const result = await shortener.shortenMany(["", "", ""]);
|
|
|
|
expect(result).toEqual([{ shortLink: "" }, { shortLink: "" }, { shortLink: "" }]);
|
|
});
|
|
|
|
it("ignores options parameter", async () => {
|
|
const shortener = new NoopShortener();
|
|
|
|
const result = await shortener.shortenMany(["https://example.com"], {
|
|
domain: "custom.com",
|
|
folderId: "folder123",
|
|
});
|
|
|
|
expect(result).toEqual([{ shortLink: "https://example.com" }]);
|
|
});
|
|
});
|