fix: persistencia dinamica em configs e filtro de tabelas ativas status publish
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user