Skip to content

test(ErrorService): add behavioral tests for redirectError, redirectIfError, and redirectIfDenied#291

Closed
PowerKiKi with Copilot wants to merge 3 commits into
apollo-v4from
copilot/fix-review-comment-290
Closed

test(ErrorService): add behavioral tests for redirectError, redirectIfError, and redirectIfDenied#291
PowerKiKi with Copilot wants to merge 3 commits into
apollo-v4from
copilot/fix-review-comment-290

Conversation

Copilot AI commented Jul 24, 2026

Copy link
Copy Markdown

The ErrorService spec only asserted construction; the three core methods had no test coverage.

Changes

  • error.service.spec.ts: Expanded the spec with behavioral tests covering:
    • redirectError() — navigates to /error with skipLocationChange, stores the error, and captures the originating href
    • redirectIfError() — redirects and rethrows on observable error; passes values through on success
    • redirectIfDenied() — redirects on false; passes true through without navigating

All subscribe callbacks include explicit error handlers (done.fail / fail) to surface unexpected errors as clear test failures.

PowerKiKi and others added 2 commits July 24, 2026 10:21
Going forward the main differences in usage are:

```diff
 apollo
     .query({query: myQuery})
     .pipe(
+        ignoreErrors(),
         map(result => result.data.myQuery),
     );
```

```diff
 apollo
     .watchQuery({
         query: myQuery,
+        notifyOnNetworkStatusChange: false,
     })
     .valueChanges
     .pipe(
+        onlyCompleteData(),
         map(result => result.data.myQuery),
     );
```

Alos, Natural has a new `createErrorLink()`, with related
tests moved from Epicerio. To make it reasonnable a feature-complete
`ErrorService` now also lives in Natural, instead of in each projects
with very minor differences.
Copilot AI changed the title [WIP] Fix code based on review comment 290 test(ErrorService): add behavioral tests for redirectError, redirectIfError, and redirectIfDenied Jul 24, 2026
Copilot AI requested a review from PowerKiKi July 24, 2026 01:29
@PowerKiKi PowerKiKi closed this Jul 24, 2026
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