Skip to content

Commit e332711

Browse files
committed
test: fix date-picker-pro unit test failed
1 parent bc51499 commit e332711

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/devui-vue/devui/date-picker-pro/__tests__/date-picker-pro.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ describe('date-picker-pro test', () => {
237237
const pickerPanel = document.querySelector(pickerPanelClass);
238238
const tableMonthItems = pickerPanel?.querySelectorAll(tableMonthClass);
239239
const date = new Date();
240-
const todayIndex = 7 - ((date.getDate() - date.getDay()) % 7) + date.getDate();
241-
const selectIndex = todayIndex > 20 ? todayIndex - 1 : todayIndex + 1;
240+
const todayIndex = getDateIndex(date);
241+
const selectIndex = getSelectedIndex(todayIndex);
242242
// 虚拟列表 当前面板呈现月为虚拟列表的第二个tableMonthItem
243243
const monthContentContainer = tableMonthItems?.[1].querySelector(ns.e('table-month-content'));
244244
const Items = monthContentContainer?.querySelectorAll('td');

0 commit comments

Comments
 (0)