Skip to content

Commit

Permalink
test: Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
motss committed Jan 16, 2021
1 parent 22f47c4 commit b86ed17
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
<app-datepicker></app-datepicker>

<app-datepicker-dialog class="datepicker-dialog"></app-datepicker-dialog>
<button type="button" class="open-btn">Open datepicker</button>
<button class="open-btn" type="button">Open datepicker</button>
</body>
</html>
10 changes: 5 additions & 5 deletions src/datepicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -755,16 +755,16 @@ export class Datepicker extends LitElement {

return html`
<button
type="button"
class="${classMap({ 'btn__year-selector': true, selected: !isCalendarView })}"
type="button"
part="year-selector"
data-view="${'yearList' as StartView}"
@click="${this._updateView('yearList')}">${formatterFy}</button>
<div class="datepicker-toolbar" part="toolbar">
<button
type="button"
class="${classMap({ 'btn__calendar-selector': true, selected: isCalendarView })}"
type="button"
part="calendar-selector"
data-view="${'calendar' as StartView}"
@click="${this._updateView('calendar')}">${formattedDate}</button>
Expand All @@ -781,11 +781,11 @@ export class Datepicker extends LitElement {
<div class="year-list-view__full-list" part="year-list" @click="${this._updateYear}">
${this._yearList.map(n =>
html`<button
type="button"
class="${classMap({
'year-list-view__list-item': true,
'year--selected': focusedDateFy === n,
})}"
type="button"
part="year"
.year="${n}">${yearFormat(toUTCDate(n, 0, 1))}</button>`)
}</div>
Expand Down Expand Up @@ -944,8 +944,8 @@ export class Datepicker extends LitElement {
<div class="calendar-view__month-selector" part="month-selectors">
<div class="month-selector-container">${hasMinDate ? null : html`
<button
type="button"
class="btn__month-selector"
type="button"
part="month-selector"
aria-label="Previous month"
@click="${this._updateMonth('previous')}"
Expand All @@ -954,8 +954,8 @@ export class Datepicker extends LitElement {
<div class="month-selector-container">${hasMaxDate ? null : html`
<button
type="button"
class="btn__month-selector"
type="button"
part="month-selector"
aria-label="Next month"
@click="${this._updateMonth('next')}"
Expand Down
2 changes: 1 addition & 1 deletion src/tests/app-datepicker-dialog/attributes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ describe(`${DATEPICKER_DIALOG_NAME}::attributes`, () => {
allStrictEqual([attr, prop], expectedNoFocusTap);
strictEqual(
cleanHtml(activeElementContent),
prettyHtml`<button type="button" class="btn__year-selector" data-view="yearList">2020</button>`
prettyHtml`<button class="btn__year-selector" type="button" data-view="yearList">2020</button>`
);
});

Expand Down
2 changes: 1 addition & 1 deletion src/tests/app-datepicker-dialog/keyboards.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ describe(`${DATEPICKER_DIALOG_NAME}::keyboards`, () => {
strictEqual(prop4, '2022-02-20');

strictEqual(cleanHtml(yearSelectorButtonContent), prettyHtml`
<button type="button" class="btn__year-selector" data-view="yearList">2022</button>
<button class="btn__year-selector" type="button" data-view="yearList">2022</button>
`);
strictEqual(cleanHtml(calendarLabelContent), prettyHtml`
<div class="calendar-label">February 2022</div>
Expand Down
2 changes: 1 addition & 1 deletion src/tests/app-datepicker-dialog/mouses.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ describe(`${DATEPICKER_DIALOG_NAME}::mouses`, () => {
strictEqual(prop2, '2022-02-20');

strictEqual(cleanHtml(yearSelectorButtonContent), prettyHtml`
<button type="button" class="btn__year-selector" data-view="yearList">2022</button>
<button class="btn__year-selector" type="button" data-view="yearList">2022</button>
`);
strictEqual(cleanHtml(calendarLabelContent), prettyHtml`
<div class="calendar-label">February 2022</div>
Expand Down
2 changes: 1 addition & 1 deletion src/tests/app-datepicker-dialog/properties.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ describe(`${DATEPICKER_DIALOG_NAME}::properties`, () => {
strictEqual(prop, expectedNoFocusTap);
strictEqual(
cleanHtml(activeElementContent),
prettyHtml`<button type="button" class="btn__year-selector" data-view="yearList">2020</button>`
prettyHtml`<button class="btn__year-selector" type="button" data-view="yearList">2020</button>`
);
});

Expand Down
2 changes: 1 addition & 1 deletion src/tests/app-datepicker/initial-render.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ describe('initial render', () => {
}, DATEPICKER_NAME, '.year-list-view__list-item.year--selected');

strictEqual(cleanHtml(focusedYearContent), prettyHtml`
<button type="button" class="year-list-view__list-item year--selected">2020</button>
<button class="year-list-view__list-item year--selected" type="button">2020</button>
`);
});

Expand Down
2 changes: 1 addition & 1 deletion src/tests/app-datepicker/mouses.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ describe('mouses', () => {

strictEqual(prop, '2022-02-20');
strictEqual(cleanHtml(yearSelectorButtonContent), prettyHtml`
<button type="button" class="btn__year-selector" data-view="yearList">2022</button>
<button class="btn__year-selector" type="button" data-view="yearList">2022</button>
`);
strictEqual(cleanHtml(calendarLabelContent), prettyHtml`
<div class="calendar-label">February 2022</div>
Expand Down

0 comments on commit b86ed17

Please sign in to comment.