-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(area): columns-placeholder prop rendering error #12857
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #12857 +/- ##
==========================================
+ Coverage 89.67% 89.76% +0.08%
==========================================
Files 257 257
Lines 6957 6957
Branches 1711 1711
==========================================
+ Hits 6239 6245 +6
+ Misses 382 379 -3
+ Partials 336 333 -3 ☔ View full report in Codecov by Sentry. |
可以补充一下对应的单测 |
@inottn 已添加单测,测试结果如下: |
嗯,这个是 demo 的快照测试,没有覆盖到本次 PR 对应的 issue。可以试着编写一个单测,确保它在这个 PR 前运行失败,在这个 PR 后运行成功。 |
get~ 我试下 |
@inottn 大佬看下是否符合预期,新增单测用例如下: test('should columns placeholder displayed normally', async () => {
const columnsPlaceholder = ['省份', '城市', '区县']
const wrapper = mount(Area, {
props: {
areaList,
columnsPlaceholder,
},
});
const columns = await wrapper.findAll('.van-picker-column');
// 点击省份(第一列第二行)
await columns[0].findAll('li')?.[1].trigger('click');
// 点击后获取第二列第一行内容,判断是否 === columnsPlaceholder[1] => '城市'
expect(columns[1].find('li').text()).toBe(columnsPlaceholder[1])
// 点击城市(第二列第二行)
await columns[1].findAll('li')?.[1].trigger('click');
// 点击后获取第三列第一行内容,判断是否 === columnsPlaceholder[2] => '区县'
expect(columns[2].find('li').text()).toBe(columnsPlaceholder[2])
}); |
Thanks! ❤️ |
Before submitting a pull request, please read the contributing guide.
在提交 pull request 之前,请阅读 贡献指南。
bugfix #12856
当传入 placeholder 后,处理

市
、区
数据有点问题,尝试如下修改: