Skip to content

Commit

Permalink
fix(test): 时区问题
Browse files Browse the repository at this point in the history
  • Loading branch information
QiuShuiBai committed Mar 14, 2024
1 parent 9f4edb2 commit 856ae12
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ describe('component picker unit test', function () {
expect(valueChangeDetail).toEqual({
formatedTime: '2022/12/12 12:00',
selectedText: '12月12日 12点:00分',
selectedTime: 1670817600000
selectedTime: +new Date('2022/12/12 12:00')
})
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ describe('component picker unit test', function () {
expect(valueChangeDetail).toEqual({
formatedTime: '2022/12/12 12:00',
selectedText: '12月12日 12点:00分',
selectedTime: 1670817600000
selectedTime: +new Date('2022/12/12 12:00')
})
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,12 @@ describe('component picker unit test', function () {
const columnChangeDetail3 = columnChange.mock.calls[2][0].detail
const changeDetail = change.mock.calls[0][0].detail
expect(columnChangeDetail1).toEqual({
column: 0, index: 1, text: '12月12日', value: 1670819400000
column: 0, index: 1, text: '12月12日', value: +new Date(2022, 11, 12, 12, 30)
})
expect(columnChangeDetail2).toEqual({ column: 1, index: 12, text: '12点', value: 12 })
expect(columnChangeDetail3).toEqual({ column: 2, index: 3, text: '30分', value: 30 })
expect(changeDetail).toEqual({
selectedTime: 1670819400000,
selectedTime: +new Date(2022, 11, 12, 12, 30),
selectedText: '12月12日 12点:30分',
formatedTime: '2022/12/12 12:30format测试', // 同时也测下format
selectedIndex: [1, 12, 3]
Expand All @@ -203,7 +203,7 @@ describe('component picker unit test', function () {
// getSelectedInfo
const info = component.instance.getSelectedInfo()
const changeProps = {
selectedTime: 1670819400000,
selectedTime: +new Date(2022, 11, 12, 12, 30),
selectedText: '12月12日 12点:30分',
formatedTime: '2022/12/12 12:30',
selectedIndex: [1, 12, 3]
Expand Down

0 comments on commit 856ae12

Please sign in to comment.