angular / angular/components

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

未关闭
#28,358 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
area: material/icon feature P3
主要语言
TypeScript
星标
25k
派生
6.8k
平均合并
1 天 8 小时
30 天内合并 PR
91

描述

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

贡献指南

打开贡献指南

调研方向

首先阅读现有的 MatIconTestingModule 和 FakeMatIconRegistry 实现,然后将当前 TestBed provider 的使用方式与所请求的 standalone API 进行比较。完成的标准是调用方可以在 providers 中使用 provideFakeIconRegistry(),而不是使用 MatIconTestingModule 或手动映射 MatIconRegistry,同时保留 fake registry 的行为。

由索引模型根据 Issue 内容生成。

评估

技术栈
angular, typescript
领域
testing
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。