angular / angular/components

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

Aperta
#28,358 0 commenti 1 reazione 0 assegnatari Vedi su GitHub
area: material/icon feature P3
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

### 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(), /* ... */],
// ...
})
```

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia leggendo le implementazioni esistenti di MatIconTestingModule e FakeMatIconRegistry, quindi confronta l’uso attuale dei provider di TestBed con l’API standalone richiesta. Il lavoro è completato quando i chiamanti possono usare provideFakeIconRegistry() in providers invece di MatIconTestingModule o della mappatura manuale di MatIconRegistry, mantenendo il comportamento del registro fittizio.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
angular, typescript
Ambito
testing
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.