Complete training workflow and acceptance hardening
This commit is contained in:
parent
4c4b91064f
commit
7237265833
243 changed files with 17014 additions and 1500 deletions
36
frontend/scripts/test-dds-history.mjs
Normal file
36
frontend/scripts/test-dds-history.mjs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
import assert from "node:assert/strict";
|
||||
|
||||
import { filterSortHistory } from "../src/pages/dds/history.mjs";
|
||||
|
||||
const cards = [
|
||||
{ card_id: "36814001", scenario_id: "t01-1", title: "Медицинская помощь",
|
||||
received_at: "2026-09-24T14:55:00+03:00", managed_service: "01", recipient_services: ["01"] },
|
||||
{ card_id: "36814002", scenario_id: "t01-2", title: "Пожар в квартире",
|
||||
received_at: "2026-09-25T14:50:00+03:00", managed_service: "01", recipient_services: ["01", "02"] },
|
||||
{ card_id: "36814003", scenario_id: "t01-3", title: "Старая запись без снимка адресатов",
|
||||
ended_at: "2026-09-23T14:50:00+03:00", managed_service: null },
|
||||
];
|
||||
|
||||
const recipients02 = filterSortHistory(cards, {
|
||||
query: "", service: "all", notification: "02", descending: true,
|
||||
});
|
||||
assert.deepEqual(recipients02.map((item) => item.card_id), ["36814002"]);
|
||||
|
||||
const descending = filterSortHistory(cards, {
|
||||
query: "", service: "all", notification: "all", descending: true,
|
||||
});
|
||||
assert.deepEqual(descending.map((item) => item.card_id), ["36814002", "36814001", "36814003"]);
|
||||
|
||||
const ascending = filterSortHistory(cards, {
|
||||
query: "", service: "all", notification: "all", descending: false,
|
||||
});
|
||||
assert.deepEqual(ascending.map((item) => item.card_id), ["36814003", "36814001", "36814002"]);
|
||||
|
||||
const combined = filterSortHistory(cards, {
|
||||
query: "ПОЖАР", service: "01", notification: "02", descending: true,
|
||||
});
|
||||
assert.deepEqual(combined.map((item) => item.card_id), ["36814002"]);
|
||||
assert.deepEqual(cards.map((item) => item.card_id), ["36814001", "36814002", "36814003"],
|
||||
"filter/sort must not mutate the source archive list");
|
||||
|
||||
console.log("DDS archive recipient filters, combined search, sorting, and immutability passed.");
|
||||
Loading…
Reference in a new issue