mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-05-06 08:47:18 +00:00
d23c2f3b53
Co-authored-by: Pablo F.G <pablo.fernandez@prowler.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
38 lines
1.4 KiB
TypeScript
38 lines
1.4 KiB
TypeScript
import { readFileSync } from "node:fs";
|
|
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
describe("providers page", () => {
|
|
it("does not use unstable Date.now keys for the providers DataTable", () => {
|
|
const currentDir = path.dirname(fileURLToPath(import.meta.url));
|
|
const pagePath = path.join(currentDir, "page.tsx");
|
|
const source = readFileSync(pagePath, "utf8");
|
|
|
|
expect(source).not.toContain("key={`providers-${Date.now()}`}");
|
|
});
|
|
|
|
it("does not pass non-serializable DataTable callbacks from the server page", () => {
|
|
const currentDir = path.dirname(fileURLToPath(import.meta.url));
|
|
const pagePath = path.join(currentDir, "page.tsx");
|
|
const source = readFileSync(pagePath, "utf8");
|
|
|
|
expect(source).not.toContain("getSubRows={(row) => row.subRows}");
|
|
});
|
|
|
|
it("keeps expandable providers columns on explicit fixed widths", () => {
|
|
const currentDir = path.dirname(fileURLToPath(import.meta.url));
|
|
const columnsPath = path.join(
|
|
currentDir,
|
|
"../../../components/providers/table/column-providers.tsx",
|
|
);
|
|
const source = readFileSync(columnsPath, "utf8");
|
|
|
|
// Provider is fixed, Provider Groups is fluid (no explicit size)
|
|
expect(source).toContain("size: 420");
|
|
expect(source).toContain("size: 160");
|
|
expect(source).toContain("size: 140");
|
|
});
|
|
});
|