feat(hk): explain background updates with protected content links and retry details
This commit is contained in:
1 parent
dd7613850e
commit
c5c9941768
42 files changed
+1542
-145
No files matched your search
@@ -7,6 +7,7 @@ const state = vi.hoisted(() => ({
|
||||
articles: [] as Array<{
|
||||
id: string;
|
||||
userId: number | null;
|
||||
title?: string;
|
||||
status: string;
|
||||
publishAt: Date;
|
||||
}>,
|
||||
@@ -146,8 +147,13 @@ it("uses the same UTC cutoff and publication timestamps regardless of the MySQL
|
||||
);
|
||||
expect(statements).toHaveLength(2);
|
||||
for (const statement of statements) {
|
||||
expect(format(statement.sql, statement.params, false, "+02:00")).toBe(
|
||||
format(statement.sql, statement.params, false, "-07:00"),
|
||||
const values = statement.params.map((value) => {
|
||||
if (typeof value !== "string")
|
||||
throw new Error("Expected explicit SQL string parameters");
|
||||
return value;
|
||||
});
|
||||
expect(format(statement.sql, values, false, "+02:00")).toBe(
|
||||
format(statement.sql, values, false, "-07:00"),
|
||||
);
|
||||
}
|
||||
expect(statements[0].params).toEqual(["2030-06-01 08:09:10.123"]);
|
||||
@@ -158,3 +164,13 @@ it("uses the same UTC cutoff and publication timestamps regardless of the MySQL
|
||||
"2030-06-01 08:09:10.123",
|
||||
]);
|
||||
});
|
||||
|
||||
it("records the article title and exact identifier for the operation screen", async () => {
|
||||
state.articles[0].title = "Scheduled community news";
|
||||
await publishDueArticles(now);
|
||||
expect(JSON.parse(String(state.operations[0][5]))).toEqual({
|
||||
articleId: "1",
|
||||
articleTitle: "Scheduled community news",
|
||||
published: true,
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user