баг-фикс 30/34
This commit is contained in:
1 parent
3d798c13e3
commit
bc0e1ab1b4
172 files changed
+13431
-2910
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
|
||||
process.env.TZ = 'Europe/Moscow';
|
||||
|
||||
const { formatLocalDate } = await import('../admin/js/utils.js');
|
||||
|
||||
test('date-only форматируется по московским компонентам, а не через UTC', () => {
|
||||
assert.equal(formatLocalDate(new Date('2026-01-01T21:15:00Z')), '2026-01-02');
|
||||
});
|
||||
|
||||
test('date-only сохраняет локальный день до московской полуночи', () => {
|
||||
assert.equal(formatLocalDate(new Date('2026-01-01T20:59:59Z')), '2026-01-01');
|
||||
});
|
||||
|
||||
test('некорректная дата отклоняется явной русской ошибкой', () => {
|
||||
assert.throws(() => formatLocalDate(new Date('invalid')), /Ожидалась корректная дата/);
|
||||
});
|
||||
Reference in new issue
Block a user