ionic-team / ionic-team/ionic-framework
bug: karma tests sometimes warn about missing contentId on menu even if present
- 主要语言
- TypeScript
- 星标
- 52.7k
- 派生
- 13.3k
- 平均合并
- 1 天 15 小时
- 30 天内合并 PR
- 51
描述
### Prerequisites
- [X] I have read the [Contributing Guidelines](https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#creating-an-issue).
- [X] I agree to follow the [Code of Conduct](https://ionicframework.com/code-of-conduct).
- [X] I have searched for [existing issues](https://github.com/ionic-team/ionic-framework/issues) that already report this problem, without success.
### Ionic Framework Version
- [ ] v4.x
- [X] v5.x
- [X] v6.x
### Current Behavior
Sometimes when running Karma tests in an Ionic Angular side menu app, Ionic will give the following errors/warnings:
```
ERROR: 'Menu: must have a "content" element to listen for drag events on.'
WARN: 'split pane does not have a specified main node'
```
This is happening even if `contentId` is set on `ion-split-pane` and `ion-menu`. Digging into it, it appears that `contentId` sometimes does not work but `content-id` does. Looks to be some sort of race condition, possibly with either our Angular component wrappers or Web Component upgrading.
### Expected Behavior
I would expect no error/warning to be logged when using contentId as directed.
### Steps to Reproduce
1. Run `ionic start foo sidemenu --type=angular`
2. Run `cd ./foo`
3. Run `ng test`
4. Observe that an error/warning is logged. Since this is a race condition, you may need to run this a few times.
### Code Reproduction URL
_No response_
### Ionic Info
_No response_
### Additional Information
_No response_
贡献指南
调研方向
Start by generating the Angular sidemenu app with `ionic start foo sidemenu --type=angular`, then run `ng test` repeatedly to reproduce the intermittent warnings. Inspect the Angular component wrappers and Web Component upgrading around `contentId` and `content-id`. Done means the menu and split pane no longer warn when `contentId` is configured.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- angular, typescript
- 领域
- frontend, testing-qa
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100