mirror of
https://github.com/outline/outline.git
synced 2026-12-01 17:32:49 +03:00
test: align popularity score tests with hour offset
This commit is contained in:
1 file changed
+2
-2
@@ -21,7 +21,7 @@ describe("UpdateDocumentsPopularityScoreTask", () => {
|
||||
|
||||
beforeEach(() => {
|
||||
task = new UpdateDocumentsPopularityScoreTask();
|
||||
vi.spyOn(Date.prototype, "getHours").mockReturnValue(0);
|
||||
vi.spyOn(Date.prototype, "getHours").mockReturnValue(6);
|
||||
|
||||
// Ensure calculation query sees data created in tests by redirecting to main sequelize instance.
|
||||
// We only mock if the instances are different to avoid infinite recursion.
|
||||
@@ -303,7 +303,7 @@ describe("UpdateDocumentsPopularityScoreTask", () => {
|
||||
expect(Number(untouched?.popularityScore)).toBe(0);
|
||||
|
||||
const onInterval = new Date();
|
||||
onInterval.setHours(0, 0, 0, 0);
|
||||
onInterval.setHours(6, 0, 0, 0);
|
||||
|
||||
await task.perform({ ...props, scheduledAt: onInterval.getTime() });
|
||||
|
||||
|
||||
Reference in new issue
Block a user