Add ESLint back into CI pipeline
This commit is contained in:
@@ -160,7 +160,7 @@ describe("Page Flow Integration", () => {
|
||||
);
|
||||
expect(cards.length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
|
||||
// Check that all three cards are rendered
|
||||
const cards = screen.getAllByText(
|
||||
/Document how your community|Build an operating manual|Get a link to your manual/,
|
||||
@@ -206,7 +206,7 @@ describe("Page Flow Integration", () => {
|
||||
const headings = screen.getAllByRole("heading");
|
||||
expect(headings.length).toBeGreaterThan(4); // Should have multiple headings
|
||||
});
|
||||
|
||||
|
||||
// Check for proper heading hierarchy
|
||||
const headings = screen.getAllByRole("heading");
|
||||
expect(headings.length).toBeGreaterThan(4); // Should have multiple headings
|
||||
|
||||
@@ -326,17 +326,25 @@ class PlaywrightPerformanceMonitor extends PerformanceMonitor {
|
||||
// Navigate to the page
|
||||
// Use "load" instead of "networkidle" to handle dynamically imported components
|
||||
// "networkidle" can timeout with code splitting as chunks load asynchronously
|
||||
await this.page.goto(url, {
|
||||
await this.page.goto(url, {
|
||||
waitUntil: "load",
|
||||
timeout: 60000, // 60 second timeout for slower networks
|
||||
});
|
||||
} catch (error) {
|
||||
// Handle interstitial/blocking errors
|
||||
if (error.message.includes("interstitial") || error.message.includes("prevented")) {
|
||||
console.warn("Page load was blocked, attempting to continue:", error.message);
|
||||
if (
|
||||
error.message.includes("interstitial") ||
|
||||
error.message.includes("prevented")
|
||||
) {
|
||||
console.warn(
|
||||
"Page load was blocked, attempting to continue:",
|
||||
error.message,
|
||||
);
|
||||
// Try to wait for the page to be in a usable state
|
||||
try {
|
||||
await this.page.waitForLoadState("domcontentloaded", { timeout: 10000 });
|
||||
await this.page.waitForLoadState("domcontentloaded", {
|
||||
timeout: 10000,
|
||||
});
|
||||
} catch {
|
||||
throw new Error(`Page failed to load: ${error.message}`);
|
||||
}
|
||||
@@ -349,9 +357,11 @@ class PlaywrightPerformanceMonitor extends PerformanceMonitor {
|
||||
// This ensures code-split components have loaded
|
||||
try {
|
||||
// Wait for main content sections that use dynamic imports
|
||||
await this.page.waitForSelector("section", { timeout: 10000 }).catch(() => {
|
||||
// Ignore if sections don't appear - page might still be valid
|
||||
});
|
||||
await this.page
|
||||
.waitForSelector("section", { timeout: 10000 })
|
||||
.catch(() => {
|
||||
// Ignore if sections don't appear - page might still be valid
|
||||
});
|
||||
} catch (error) {
|
||||
// Continue even if some components haven't loaded - we still want to measure performance
|
||||
console.warn("Some components may not have loaded:", error.message);
|
||||
|
||||
@@ -200,7 +200,7 @@ describe("BlogPostPage", () => {
|
||||
await waitFor(() => {
|
||||
expect(screen.getByTestId("related-articles")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
|
||||
expect(screen.getByText("Related Articles")).toBeInTheDocument();
|
||||
expect(screen.getByTestId("related-related-1")).toBeInTheDocument();
|
||||
expect(screen.getByTestId("related-related-2")).toBeInTheDocument();
|
||||
|
||||
@@ -100,7 +100,8 @@ describe("Page", () => {
|
||||
// Wait for dynamically imported FeatureGrid component to load
|
||||
await waitFor(() => {
|
||||
expect(
|
||||
screen.getAllByText("We've got your back, every step of the way").length,
|
||||
screen.getAllByText("We've got your back, every step of the way")
|
||||
.length,
|
||||
).toBeGreaterThan(0);
|
||||
});
|
||||
expect(
|
||||
@@ -143,7 +144,8 @@ describe("Page", () => {
|
||||
// FeatureGrid
|
||||
await waitFor(() => {
|
||||
expect(
|
||||
screen.getAllByText("We've got your back, every step of the way").length,
|
||||
screen.getAllByText("We've got your back, every step of the way")
|
||||
.length,
|
||||
).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
@@ -212,7 +214,7 @@ describe("Page", () => {
|
||||
|
||||
// Check all section titles (using getAllByText since there are multiple instances)
|
||||
expect(screen.getAllByText("Collaborate").length).toBeGreaterThan(0);
|
||||
|
||||
|
||||
// Wait for dynamically imported components
|
||||
await waitFor(() => {
|
||||
expect(
|
||||
@@ -221,7 +223,8 @@ describe("Page", () => {
|
||||
});
|
||||
await waitFor(() => {
|
||||
expect(
|
||||
screen.getAllByText("We've got your back, every step of the way").length,
|
||||
screen.getAllByText("We've got your back, every step of the way")
|
||||
.length,
|
||||
).toBeGreaterThan(0);
|
||||
});
|
||||
expect(screen.getAllByText("Still have questions?").length).toBeGreaterThan(
|
||||
@@ -236,7 +239,8 @@ describe("Page", () => {
|
||||
await waitFor(() => {
|
||||
// Check all three numbered card items (using getAllByText since there are multiple instances)
|
||||
expect(
|
||||
screen.getAllByText("Document how your community makes decisions").length,
|
||||
screen.getAllByText("Document how your community makes decisions")
|
||||
.length,
|
||||
).toBeGreaterThan(0);
|
||||
});
|
||||
expect(
|
||||
@@ -256,7 +260,7 @@ describe("Page", () => {
|
||||
|
||||
// Check subtitles (using getAllByText since there are multiple instances)
|
||||
expect(screen.getAllByText("with clarity").length).toBeGreaterThan(0);
|
||||
|
||||
|
||||
// Wait for dynamically imported components
|
||||
await waitFor(() => {
|
||||
expect(
|
||||
|
||||
@@ -26,7 +26,9 @@ describe("useClickOutside", () => {
|
||||
result.current.current = div;
|
||||
|
||||
act(() => {
|
||||
document.body.dispatchEvent(new MouseEvent("mousedown", { bubbles: true }));
|
||||
document.body.dispatchEvent(
|
||||
new MouseEvent("mousedown", { bubbles: true }),
|
||||
);
|
||||
});
|
||||
|
||||
expect(handler).toHaveBeenCalledTimes(1);
|
||||
@@ -62,7 +64,9 @@ describe("useClickOutside", () => {
|
||||
});
|
||||
|
||||
act(() => {
|
||||
document.body.dispatchEvent(new MouseEvent("mousedown", { bubbles: true }));
|
||||
document.body.dispatchEvent(
|
||||
new MouseEvent("mousedown", { bubbles: true }),
|
||||
);
|
||||
});
|
||||
|
||||
expect(handler).not.toHaveBeenCalled();
|
||||
@@ -84,7 +88,9 @@ describe("useClickOutside", () => {
|
||||
result.current.ref2.current = div2;
|
||||
|
||||
act(() => {
|
||||
document.body.dispatchEvent(new MouseEvent("mousedown", { bubbles: true }));
|
||||
document.body.dispatchEvent(
|
||||
new MouseEvent("mousedown", { bubbles: true }),
|
||||
);
|
||||
});
|
||||
|
||||
expect(handler).toHaveBeenCalledTimes(1);
|
||||
|
||||
Reference in New Issue
Block a user