18 lines
544 B
TypeScript
18 lines
544 B
TypeScript
import { describe, expect, test } from "vitest";
|
|
|
|
import { getStarIdFromUrl } from "../src/shared/get-star-id";
|
|
|
|
describe("getStarIdFromUrl", () => {
|
|
test("returns the star id from a creator detail page url", () => {
|
|
expect(
|
|
getStarIdFromUrl(
|
|
"https://xingtu.cn/ad/creator/author-homepage/douyin-video/6629661559960371207?foo=bar"
|
|
)
|
|
).toBe("6629661559960371207");
|
|
});
|
|
|
|
test("returns null for non-matching urls", () => {
|
|
expect(getStarIdFromUrl("https://xingtu.cn/ad/creator/market")).toBeNull();
|
|
});
|
|
});
|