angular / angular/components

feat(icon): provide standalone-friendly APIs for icon registry testing

Open
#28,358 0 comments 1 reaction 0 assignees View on GitHub
area: material/icon feature P3
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

### Feature Description

It would be nice to have a standalone `provideFakeIconRegistry` function to provide the `MatIconRegistry` with `FakeMatIconRegistry` as a replacement for using `MatIconTestingModule`.

This feature request is motivated by the want to enforce standalone APIs way of doing.

Just like the effort made in this commit : https://github.com/angular/components/commit/7840cd3a779b6e7388971e279bd60de2bcb1e89b

### Use Case

Replace :
```ts
TestBed.configureTestingModule({
imports: [MatIconTestingModule, /* ... */],
// ...
})

// OR

TestBed.configureTestingModule({
providers: [
//...
{
provide: MatIconRegistry,
useClass: FakeMatIconRegistry,
},
],
// ...
})
```

By :
```ts
TestBed.configureTestingModule({
providers: [provideFakeIconRegistry(), /* ... */],
// ...
})
```

Contributor guide

Open the contributing guide

Research direction

Start by reading the existing MatIconTestingModule and FakeMatIconRegistry implementations, then compare the current TestBed provider usage with the requested standalone API. Done means callers can use provideFakeIconRegistry() in providers instead of MatIconTestingModule or the manual MatIconRegistry mapping, while retaining the fake registry behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.