That stores the Inject decorator/function result, not an injected NetworkState instance. It should be inject(NetworkState) (or constructor injection).
The existing spec is an it.skip placeholder with a TODO — the right behavioral tests are unclear until the DI bug is fixed (and a MockNetworkState wired correctly).
Ask
Fix DI, then un-skip / rewrite network-status.service.spec.ts to assert online/offline + connection type via a mock NetworkState.
## Context
Found during unit-test quality audit (draft PR spikersoft-angular#574).
## Bug
`projects/spikersoft/src/app/_services/marks-site/network-status/network-status.service.ts` assigns:
```ts
private readonly networkState: NetworkState = Inject(NetworkState);
```
That stores the `Inject` decorator/function result, not an injected `NetworkState` instance. It should be `inject(NetworkState)` (or constructor injection).
The existing spec is an `it.skip` placeholder with a TODO — the right behavioral tests are unclear until the DI bug is fixed (and a `MockNetworkState` wired correctly).
## Ask
Fix DI, then un-skip / rewrite `network-status.service.spec.ts` to assert online/offline + connection type via a mock `NetworkState`.
with the capital-Injectdecorator imported at :1. Calling a decorator as a function in a field initializer doesn't resolve anything from DI — exactly as filed.
The addition: NetworkStatusService has no consumer. Grepping for it across non-spec .ts files returns only its own declaration at :5. Nothing injects it anywhere.
That explains why this has never surfaced at runtime, and it changes how to think about the fix: this isn't a live DI failure users are hitting, it's a service that would break the moment someone first injects it. So it's cleanup-before-use rather than a bug fix — and worth doing before anyone wires it up, since the failure at that point would look like a problem with the consumer rather than with this file.
Priority context from the same eleven-ticket sweep: #840, #792 and #808 are all latent with no production caller. The live ones are #811 (broken AES on a real network path, security-relevant, and misleadingly carrying a test(coverage) commit that only pinned it), #793, #794, #795, #797 and #799. If these get worked as a batch, the live set is where the user-visible impact is.
This one is a genuinely two-line fix (inject(NetworkState) lowercase, drop the decorator import), so it's cheap to clear regardless.
Audited against `origin/master` — **STILL BROKEN, description exact, plus one thing worth adding to the notes.**
`projects/spikersoft/src/app/_services/marks-site/network-status/network-status.service.ts:6`:
```ts
private readonly networkState: NetworkState = Inject(NetworkState);
```
with the capital-`Inject` **decorator** imported at `:1`. Calling a decorator as a function in a field initializer doesn't resolve anything from DI — exactly as filed.
**The addition: `NetworkStatusService` has no consumer.** Grepping for it across non-spec `.ts` files returns only its own declaration at `:5`. Nothing injects it anywhere.
That explains why this has never surfaced at runtime, and it changes how to think about the fix: this isn't a live DI failure users are hitting, it's a service that would break the moment someone first injects it. So it's cleanup-before-use rather than a bug fix — and worth doing *before* anyone wires it up, since the failure at that point would look like a problem with the consumer rather than with this file.
**Priority context** from the same eleven-ticket sweep: **#840, #792 and #808** are all latent with no production caller. The live ones are **#811** (broken AES on a real network path, security-relevant, and misleadingly carrying a `test(coverage)` commit that only *pinned* it), **#793**, **#794**, **#795**, **#797** and **#799**. If these get worked as a batch, the live set is where the user-visible impact is.
This one is a genuinely two-line fix (`inject(NetworkState)` lowercase, drop the decorator import), so it's cheap to clear regardless.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Context
Found during unit-test quality audit (draft PR spikersoft-angular#574).
Bug
projects/spikersoft/src/app/_services/marks-site/network-status/network-status.service.tsassigns:That stores the
Injectdecorator/function result, not an injectedNetworkStateinstance. It should beinject(NetworkState)(or constructor injection).The existing spec is an
it.skipplaceholder with a TODO — the right behavioral tests are unclear until the DI bug is fixed (and aMockNetworkStatewired correctly).Ask
Fix DI, then un-skip / rewrite
network-status.service.spec.tsto assert online/offline + connection type via a mockNetworkState.Audited against
origin/master— STILL BROKEN, description exact, plus one thing worth adding to the notes.projects/spikersoft/src/app/_services/marks-site/network-status/network-status.service.ts:6:with the capital-
Injectdecorator imported at:1. Calling a decorator as a function in a field initializer doesn't resolve anything from DI — exactly as filed.The addition:
NetworkStatusServicehas no consumer. Grepping for it across non-spec.tsfiles returns only its own declaration at:5. Nothing injects it anywhere.That explains why this has never surfaced at runtime, and it changes how to think about the fix: this isn't a live DI failure users are hitting, it's a service that would break the moment someone first injects it. So it's cleanup-before-use rather than a bug fix — and worth doing before anyone wires it up, since the failure at that point would look like a problem with the consumer rather than with this file.
Priority context from the same eleven-ticket sweep: #840, #792 and #808 are all latent with no production caller. The live ones are #811 (broken AES on a real network path, security-relevant, and misleadingly carrying a
test(coverage)commit that only pinned it), #793, #794, #795, #797 and #799. If these get worked as a batch, the live set is where the user-visible impact is.This one is a genuinely two-line fix (
inject(NetworkState)lowercase, drop the decorator import), so it's cheap to clear regardless.