diff --git a/packages/date-picker/src/vaadin-month-calendar.js b/packages/date-picker/src/vaadin-month-calendar.js
index 91f17c195c3..80078ef246e 100644
--- a/packages/date-picker/src/vaadin-month-calendar.js
+++ b/packages/date-picker/src/vaadin-month-calendar.js
@@ -80,7 +80,9 @@ class MonthCalendar extends FocusMixin(ThemableMixin(PolymerElement)) {
is="dom-repeat"
items="[[_getWeekDayNames(i18n.weekdays, i18n.weekdaysShort, showWeekNumbers, i18n.firstDayOfWeek)]]"
>
-
[[item.weekDayShort]] |
+
+ [[item.weekDayShort]]
+ |
diff --git a/packages/date-picker/test/basic.test.js b/packages/date-picker/test/basic.test.js
index 32ebebc3218..412b8c936a6 100644
--- a/packages/date-picker/test/basic.test.js
+++ b/packages/date-picker/test/basic.test.js
@@ -304,7 +304,7 @@ describe('basic features', () => {
it('should notify i18n mutation to children', () => {
const monthCalendar = overlayContent.$.monthScroller.querySelector('vaadin-month-calendar');
const weekdays = monthCalendar.$.monthGrid.querySelectorAll('[part="weekday"]:not(:empty)');
- const weekdayTitles = Array.prototype.map.call(weekdays, (weekday) => weekday.textContent);
+ const weekdayTitles = Array.prototype.map.call(weekdays, (weekday) => weekday.textContent.trim());
expect(weekdayTitles).to.eql(['ma', 'ti', 'ke', 'to', 'pe', 'la', 'su']);
});
diff --git a/packages/date-picker/test/dom/__snapshots__/month-calendar.test.snap.js b/packages/date-picker/test/dom/__snapshots__/month-calendar.test.snap.js
index f75795ca024..2dbe5485bf0 100644
--- a/packages/date-picker/test/dom/__snapshots__/month-calendar.test.snap.js
+++ b/packages/date-picker/test/dom/__snapshots__/month-calendar.test.snap.js
@@ -64,6 +64,7 @@ snapshots["vaadin-month-calendar shadow default"] =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| {
it('should render days in correct order by default', () => {
const weekdays = monthCalendar.shadowRoot.querySelectorAll('[part="weekday"]:not(:empty)');
- const weekdayTitles = Array.from(weekdays).map((weekday) => weekday.textContent);
+ const weekdayTitles = Array.from(weekdays).map((weekday) => weekday.textContent.trim());
expect(weekdayTitles).to.eql(['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']);
});
@@ -48,7 +48,7 @@ describe('vaadin-month-calendar', () => {
monthCalendar.set('i18n.firstDayOfWeek', 1); // Start from Monday.
await aTimeout();
const weekdays = monthCalendar.shadowRoot.querySelectorAll('[part="weekday"]:not(:empty)');
- const weekdayTitles = Array.from(weekdays).map((weekday) => weekday.textContent);
+ const weekdayTitles = Array.from(weekdays).map((weekday) => weekday.textContent.trim());
expect(weekdayTitles).to.eql(['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']);
});
@@ -170,7 +170,7 @@ describe('vaadin-month-calendar', () => {
it('should render weekdays in correct locale', () => {
const weekdays = monthCalendar.shadowRoot.querySelectorAll('[part="weekday"]:not(:empty)');
- const weekdayTitles = Array.from(weekdays).map((weekday) => weekday.textContent);
+ const weekdayTitles = Array.from(weekdays).map((weekday) => weekday.textContent.trim());
expect(weekdayTitles).to.eql(['ma', 'ti', 'ke', 'to', 'pe', 'la', 'su']);
});
|