fix(dashboard): address observability review findings
This commit is contained in:
parent
2d2b905d18
commit
bfb9a91e49
11 changed files with 188 additions and 10 deletions
|
|
@ -64,10 +64,33 @@ test.describe("dashboard page QA gate", () => {
|
|||
const metrics = await page.evaluate(() => {
|
||||
const footer = document.querySelector("[data-model-id='footer-status']");
|
||||
const runtime = document.querySelector("[data-model-id='runtime-health']");
|
||||
const visibleItems = [
|
||||
...document.querySelectorAll(".telemetry-card"),
|
||||
...document.querySelectorAll(".service-row"),
|
||||
...document.querySelectorAll(".footer-cell"),
|
||||
].map((element) => {
|
||||
const rect = element.getBoundingClientRect();
|
||||
return {
|
||||
bottom: rect.bottom,
|
||||
height: rect.height,
|
||||
id: element.getAttribute("data-model-id"),
|
||||
top: rect.top,
|
||||
width: rect.width,
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
clippedItems: visibleItems.filter((item) =>
|
||||
item.top < 0 ||
|
||||
item.bottom > window.innerHeight ||
|
||||
item.width <= 0 ||
|
||||
item.height <= 0
|
||||
),
|
||||
footerCellCount: document.querySelectorAll(".footer-cell").length,
|
||||
scrollWidth: document.documentElement.scrollWidth,
|
||||
scrollHeight: document.documentElement.scrollHeight,
|
||||
serviceRowCount: document.querySelectorAll(".service-row").length,
|
||||
telemetryCardCount: document.querySelectorAll(".telemetry-card").length,
|
||||
footerBottom: footer?.getBoundingClientRect().bottom ?? 0,
|
||||
runtimeBottom: runtime?.getBoundingClientRect().bottom ?? 0,
|
||||
};
|
||||
|
|
@ -77,6 +100,10 @@ test.describe("dashboard page QA gate", () => {
|
|||
expect(metrics.scrollHeight).toBeLessThanOrEqual(956);
|
||||
expect(metrics.runtimeBottom).toBeLessThanOrEqual(956);
|
||||
expect(metrics.footerBottom).toBeLessThanOrEqual(956);
|
||||
expect(metrics.telemetryCardCount).toBe(16);
|
||||
expect(metrics.serviceRowCount).toBe(28);
|
||||
expect(metrics.footerCellCount).toBe(5);
|
||||
expect(metrics.clippedItems).toEqual([]);
|
||||
});
|
||||
|
||||
test("keeps the first screen usable on mobile", async ({ page }, testInfo) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue