Skip to content

Commit

Permalink
test(date-picker): fix test cases not idempotent
Browse files Browse the repository at this point in the history
  • Loading branch information
xxyan0205 committed Jan 2, 2020
1 parent c3c5350 commit 31981fb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 29 deletions.
37 changes: 9 additions & 28 deletions components/date-picker/test/__snapshots__/demo.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@ exports[`DatePicker - Demo Custom type and option textual values 1`] = `
<div class="md-picker-column-list">
<div class="md-picker-column-item">
<ul class="column-list" style="padding-top: 100px; margin-top: -100px;">
<li class="column-item" style="height: 45px; line-height: 45px;">1999年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2000年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2001年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2002年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2003年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2004年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2005年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2006年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2007年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2008年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2009年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2010年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2011年</li>
Expand All @@ -29,8 +19,8 @@ exports[`DatePicker - Demo Custom type and option textual values 1`] = `
<li class="column-item" style="height: 45px; line-height: 45px;">2015年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2016年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2017年</li>
<li class="column-item active" style="height: 45px; line-height: 45px;">2018年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2019年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2018年</li>
<li class="column-item active" style="height: 45px; line-height: 45px;">2019年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2020年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2021年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2022年</li>
Expand All @@ -41,16 +31,6 @@ exports[`DatePicker - Demo Custom type and option textual values 1`] = `
<li class="column-item" style="height: 45px; line-height: 45px;">2027年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2028年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2029年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2030年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2031年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2032年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2033年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2034年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2035年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2036年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2037年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2038年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2039年</li>
</ul>
</div>
<div class="md-picker-column-item">
Expand All @@ -70,8 +50,8 @@ exports[`DatePicker - Demo Custom type and option textual values 1`] = `
</ul>
</div>
<div class="md-picker-column-item">
<ul class="column-list" style="padding-top: 100px; margin-top: -100px;">
<li class="column-item" style="height: 45px; line-height: 45px;">*1日</li>
<ul class="column-list" style="padding-top: 100px;">
<li class="column-item active" style="height: 45px; line-height: 45px;">*1日</li>
<li class="column-item" style="height: 45px; line-height: 45px;">*2日</li>
<li class="column-item" style="height: 45px; line-height: 45px;">*3日</li>
<li class="column-item" style="height: 45px; line-height: 45px;">*4日</li>
Expand All @@ -80,7 +60,7 @@ exports[`DatePicker - Demo Custom type and option textual values 1`] = `
<li class="column-item" style="height: 45px; line-height: 45px;">*7日</li>
<li class="column-item" style="height: 45px; line-height: 45px;">*8日</li>
<li class="column-item" style="height: 45px; line-height: 45px;">*9日</li>
<li class="column-item active" style="height: 45px; line-height: 45px;">*10日</li>
<li class="column-item" style="height: 45px; line-height: 45px;">*10日</li>
<li class="column-item" style="height: 45px; line-height: 45px;">*11日</li>
<li class="column-item" style="height: 45px; line-height: 45px;">*12日</li>
<li class="column-item" style="height: 45px; line-height: 45px;">*13日</li>
Expand All @@ -105,16 +85,16 @@ exports[`DatePicker - Demo Custom type and option textual values 1`] = `
</ul>
</div>
<div class="md-picker-column-item">
<ul class="column-list" style="padding-top: 100px;">
<li class="column-item active" style="height: 45px; line-height: 45px;">0时</li>
<ul class="column-list" style="padding-top: 100px; margin-top: -100px;">
<li class="column-item" style="height: 45px; line-height: 45px;">0时</li>
<li class="column-item" style="height: 45px; line-height: 45px;">1时</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2时</li>
<li class="column-item" style="height: 45px; line-height: 45px;">3时</li>
<li class="column-item" style="height: 45px; line-height: 45px;">4时</li>
<li class="column-item" style="height: 45px; line-height: 45px;">5时</li>
<li class="column-item" style="height: 45px; line-height: 45px;">6时</li>
<li class="column-item" style="height: 45px; line-height: 45px;">7时</li>
<li class="column-item" style="height: 45px; line-height: 45px;">8时</li>
<li class="column-item active" style="height: 45px; line-height: 45px;">8时</li>
<li class="column-item" style="height: 45px; line-height: 45px;">9时</li>
<li class="column-item" style="height: 45px; line-height: 45px;">10时</li>
<li class="column-item" style="height: 45px; line-height: 45px;">11时</li>
Expand Down Expand Up @@ -242,6 +222,7 @@ exports[`DatePicker - Demo Date & Time selection 1`] = `
<li class="column-item" style="height: 45px; line-height: 45px;">2037年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2038年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2039年</li>
<li class="column-item" style="height: 45px; line-height: 45px;">2040年</li>
</ul>
</div>
<div class="md-picker-column-item">
Expand Down
6 changes: 5 additions & 1 deletion components/date-picker/test/cases/demo3.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
title="选择出险时间"
:text-render="textRender"
:custom-types="['yyyy', 'MM','dd', 'hh', 'mm']"
:min-date="minDate"
:max-date="maxDate"
:default-date="currentDate"
is-view
></md-date-picker>
Expand All @@ -21,7 +23,9 @@ export default {
},
data() {
return {
currentDate: new Date('2018/10/10'),
currentDate: new Date('2019-10-01 00:00'),
minDate: new Date('2009-10-01'),
maxDate: new Date('2029-10-01'),
}
},
methods: {
Expand Down

0 comments on commit 31981fb

Please sign in to comment.