fix: persistencia dinamica em configs e filtro de tabelas ativas status publish

This commit is contained in:
Andre RDS
2026-11-27 09:00:08 -03:00
parent 9e6c38ff37
commit cc6a77612b
16 changed files with 554 additions and 144 deletions
+5 -4
View File
@@ -1,6 +1,7 @@
import { test, expect, describe, beforeEach, afterEach } from "bun:test";
import { calculateTableStatus, parseRevisionDate, calculateSeverity } from "../../src/application/services/table-service.ts";
import { TableAlertFormatter } from "../../src/domain/services/table-alert-formatter.ts";
import type { ExpiryAlert } from "../../src/domain/models/table.ts";
describe("Table Status Calculation", () => {
const originalWarningDays = process.env.TABLE_EXPIRY_WARNING_DAYS;
@@ -124,7 +125,7 @@ describe("TableAlertFormatter", () => {
const formatter = new TableAlertFormatter();
test("formatExpiryAlert: expired", () => {
const alert = {
const alert: ExpiryAlert = {
table_id: "test-1",
table_title: "Plano Teste",
operadora: "Operadora X",
@@ -145,7 +146,7 @@ describe("TableAlertFormatter", () => {
});
test("formatExpiryAlert: critical", () => {
const alert = {
const alert: ExpiryAlert = {
table_id: "test-2",
table_title: "Plano Crítico",
operadora: "Operadora Z",
@@ -163,7 +164,7 @@ describe("TableAlertFormatter", () => {
});
test("formatExpiryAlert: warning", () => {
const alert = {
const alert: ExpiryAlert = {
table_id: "test-3",
table_title: "Plano Warning",
operadora: "Operadora W",
@@ -181,7 +182,7 @@ describe("TableAlertFormatter", () => {
});
test("escapeHtml: sanitiza caracteres perigosos", () => {
const alert = {
const alert: ExpiryAlert = {
table_id: "test-4",
table_title: "Plano <script>alert(1)</script>",
operadora: "Op & Co",