mirror of
https://github.com/ElemeFE/element.git
synced 2025-12-16 11:44:01 +08:00
Calendar: add first-day-of-week attribute (#16047)
This commit is contained in:
@@ -66,5 +66,24 @@ describe('Calendar', () => {
|
||||
expect(/2019.*5/.test(titleEl.innerText)).to.be.true;
|
||||
expect(cell.classList.contains('is-selected')).to.be.true;
|
||||
});
|
||||
|
||||
it('firstDayOfWeek', async() => {
|
||||
vm = createVue({
|
||||
template: `
|
||||
<el-calendar v-model="value" :first-day-of-week="0"></el-calendar>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
value: new Date('2019-04-01')
|
||||
};
|
||||
}
|
||||
}, true);
|
||||
const head = vm.$el.querySelector('.el-calendar-table thead');
|
||||
expect(head.firstElementChild.innerText).to.be.equal('日');
|
||||
expect(head.lastElementChild.innerText).to.be.equal('六');
|
||||
const firstRow = vm.$el.querySelector('.el-calendar-table__row');
|
||||
expect(firstRow.firstElementChild.innerText).to.be.equal('31');
|
||||
expect(firstRow.lastElementChild.innerText).to.be.equal('6');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user