Skip to content

fix: remove overly broad error filtering in E2E tests#243

Closed
Copilot wants to merge 2 commits intoclaude/pull-and-continue-I9Lk9from
copilot/sub-pr-238-another-one
Closed

fix: remove overly broad error filtering in E2E tests#243
Copilot wants to merge 2 commits intoclaude/pull-and-continue-I9Lk9from
copilot/sub-pr-238-another-one

Conversation

Copy link

Copilot AI commented Feb 10, 2026

The E2E tests were filtering page errors with .filter((e) => !e.includes('Warning')) before asserting the errors array was empty. This could hide real runtime exceptions that happen to contain "Warning" in their message.

Changes

  • Error assertion: Replaced filtered check with strict expect(errors).toHaveLength(0) in 7 E2E test files
  • Syntax fix: Removed duplicate closing brace in nature-detail.spec.ts line 70

Before/After

// Before - could hide exceptions like "Warning: setState called on unmounted component"
expect(errors.filter((e) => !e.includes('Warning'))).toHaveLength(0);

// After - catches all page errors
expect(errors).toHaveLength(0);

Affected test files: type-detail, ability-detail, item-detail, nature-detail, trainer-detail, location-detail, move-detail


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Replace `.filter((e) => !e.includes('Warning'))` with direct assertion
that errors array is empty. The previous pattern could hide real runtime
exceptions that happened to contain "Warning" in their message.

Affected files:
- e2e/type-detail.spec.ts
- e2e/ability-detail.spec.ts
- e2e/item-detail.spec.ts
- e2e/nature-detail.spec.ts (also fixed extra closing brace)
- e2e/trainer-detail.spec.ts
- e2e/location-detail.spec.ts
- e2e/move-detail.spec.ts

Addresses feedback: #238 (comment)

Co-authored-by: seandonn-boston <38230468+seandonn-boston@users.noreply.github.com>
Copy link
Author

Copilot AI commented Feb 10, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • checkpoint.prisma.io
    • Triggering command: /opt/hostedtoolcache/node/24.13.0/x64/bin/node /opt/hostedtoolcache/node/24.13.0/x64/bin/node /home/REDACTED/work/PkdxPlusPlus/PkdxPlusPlus/node_modules/prisma/build/child {&#34;product&#34;:&#34;prisma&#34;,&#34;version&#34;:&#34;7.3.0&#34;,&#34;cli_install_type&#34;:&#34;local&#34;,&#34;information&#34;:&#34;&#34;,&#34;local_timestamp&#34;:&#34;2026-02-10T04:20:16Z&#34;,&#34;project_hash&#34;:&#34;3cfc3272&#34;,&#34;cli_path&#34;:&#34;/home/REDACTED/work/PkdxPlusPlus/PkdxPlusPlus/node_modules/.bin/prisma&#34;,&#34;cli_path_hash&#34;:&#34;6e3b49e (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Improve E2E tests for entity detail pages fix: remove overly broad error filtering in E2E tests Feb 10, 2026
@seandonn-boston
Copy link
Owner

@copilot git apply --3way <<'EOF'
diff --git a/e2e/ability-detail.spec.ts b/e2e/ability-detail.spec.ts
index 7aadc9b..c59a1ee 100644
--- a/e2e/ability-detail.spec.ts
+++ b/e2e/ability-detail.spec.ts
@@ -11,7 +11,7 @@ test.describe('Ability Detail Page', () => {

   await expect(page.locator('text=Something went wrong')).not.toBeVisible();
   await expect(page.locator('text=overgrow').first()).toBeVisible();
  •  expect(errors.filter((e) => !e.includes('Warning'))).toHaveLength(0);
    
  •  expect(errors).toHaveLength(0);
    

    });

    test('should display ability description', async ({ page }) => {
    diff --git a/e2e/item-detail.spec.ts b/e2e/item-detail.spec.ts
    index 81bf542..7ecb257 100644
    --- a/e2e/item-detail.spec.ts
    +++ b/e2e/item-detail.spec.ts
    @@ -11,7 +11,7 @@ test.describe('Item Detail Page', () => {

     await expect(page.locator('text=Something went wrong')).not.toBeVisible();
     await expect(page.locator('text=potion').first()).toBeVisible();
    
  •  expect(errors.filter((e) => !e.includes('Warning'))).toHaveLength(0);
    
  •  expect(errors).toHaveLength(0);
    

    });

    test('should display item category', async ({ page }) => {
    diff --git a/e2e/location-detail.spec.ts b/e2e/location-detail.spec.ts
    index 74d51af..9e4a6f1 100644
    --- a/e2e/location-detail.spec.ts
    +++ b/e2e/location-detail.spec.ts
    @@ -11,7 +11,7 @@ test.describe('Location Detail Page', () => {

     await expect(page.locator('text=Something went wrong')).not.toBeVisible();
     await expect(page.locator('text=pallet town').first()).toBeVisible();
    
  •  expect(errors.filter((e) => !e.includes('Warning'))).toHaveLength(0);
    
  •  expect(errors).toHaveLength(0);
    

    });

    test('should display region information', async ({ page }) => {
    diff --git a/e2e/move-detail.spec.ts b/e2e/move-detail.spec.ts
    index 3ea206e..ca3ab92 100644
    --- a/e2e/move-detail.spec.ts
    +++ b/e2e/move-detail.spec.ts
    @@ -11,7 +11,7 @@ test.describe('Move Detail Page', () => {

     await expect(page.locator('text=Something went wrong')).not.toBeVisible();
     await expect(page.locator('text=tackle').first()).toBeVisible();
    
  •  expect(errors.filter((e) => !e.includes('Warning'))).toHaveLength(0);
    
  •  expect(errors).toHaveLength(0);
    

    });

    test('should display move type badge', async ({ page }) => {
    diff --git a/e2e/nature-detail.spec.ts b/e2e/nature-detail.spec.ts
    index 2d35e77..a37dd44 100644
    --- a/e2e/nature-detail.spec.ts
    +++ b/e2e/nature-detail.spec.ts
    @@ -11,7 +11,7 @@ test.describe('Nature Detail Page', () => {

     await expect(page.locator('text=Something went wrong')).not.toBeVisible();
     await expect(page.locator('text=adamant').first()).toBeVisible();
    
  •  expect(errors.filter((e) => !e.includes('Warning'))).toHaveLength(0);
    
  •  expect(errors).toHaveLength(0);
    

    });

    test('should display stat changes', async ({ page }) => {
    @@ -67,7 +67,6 @@ test.describe('Nature Detail Page', () => {
    await expect(page.getByText('⚖️')).toBeVisible();
    });
    });

  • });

    test.describe('Breadcrumbs', () => {
    test('should have breadcrumb link back to Natures', async ({ page }) => {
    diff --git a/e2e/trainer-detail.spec.ts b/e2e/trainer-detail.spec.ts
    index 2095179..ca4d20b 100644
    --- a/e2e/trainer-detail.spec.ts
    +++ b/e2e/trainer-detail.spec.ts
    @@ -11,7 +11,7 @@ test.describe('Trainer Detail Page', () => {

    await expect(page.locator('text=Something went wrong')).not.toBeVisible();
    await expect(page.locator('text=Brock').first()).toBeVisible();
    
  •  expect(errors.filter((e) => !e.includes('Warning'))).toHaveLength(0);
    
  •  expect(errors).toHaveLength(0);
    

    });

    test('should display trainer title', async ({ page }) => {
    diff --git a/e2e/type-detail.spec.ts b/e2e/type-detail.spec.ts
    index 761cd64..6490f38 100644
    --- a/e2e/type-detail.spec.ts
    +++ b/e2e/type-detail.spec.ts
    @@ -11,7 +11,7 @@ test.describe('Type Detail Page', () => {

     await expect(page.locator('text=Something went wrong')).not.toBeVisible();
     await expect(page.locator('text=fire').first()).toBeVisible();
    
  •  expect(errors.filter((e) => !e.includes('Warning'))).toHaveLength(0);
    
  •  expect(errors).toHaveLength(0);
    

    });

    test('should display type matchups', async ({ page }) => {

EOFa

Copy link
Author

Copilot AI commented Feb 10, 2026

@copilot git apply --3way <<'EOF'
diff --git a/e2e/ability-detail.spec.ts b/e2e/ability-detail.spec.ts
index 7aadc9b..c59a1ee 100644
...

These changes have already been applied in commit 2be955d. All 7 E2E test files now use expect(errors).toHaveLength(0) instead of the filtered check, and the duplicate closing brace in nature-detail.spec.ts has been removed.

@seandonn-boston seandonn-boston marked this pull request as ready for review February 17, 2026 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants