Skip to content

Commit

Permalink
fix(calendar): impersistent dates fail snapshot matching tests (#605)
Browse files Browse the repository at this point in the history
* fix(calendar): impersistent dates fail snapshot matching tests

* removed snapshot test

* retrieved snapshot

* calendar snapshot

* updated snapshot

* updated snapshot
  • Loading branch information
yinonov authored Jan 24, 2021
1 parent 3d52a32 commit 2c4ee98
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
32 changes: 16 additions & 16 deletions __snapshots__/Calendar.md → __snapshots__/calendar.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
# `Calendar`
# `calendar`

#### `should internal contents`
#### `should match internal contents`

```html
<div class="container">
<ol class="headline">
<li>
<time datetime="2021-01-17">
17 Sun
<time datetime="2021-01-31">
31 Sun
</time>
</li>
<li>
<time datetime="2021-01-18">
18 Mon
<time datetime="2021-01-01">
01 Fri
</time>
</li>
<li>
<time datetime="2021-01-19">
19 Tue
<time datetime="2021-01-02">
02 Sat
</time>
</li>
<li>
<time datetime="2021-01-20">
20 Wed
<time datetime="2021-01-03">
03 Sun
</time>
</li>
<li>
<time datetime="2021-01-21">
21 Thu
<time datetime="2021-01-04">
04 Mon
</time>
</li>
<li>
<time datetime="2021-01-22">
22 Fri
<time datetime="2021-01-05">
05 Tue
</time>
</li>
<li>
<time datetime="2021-01-23">
23 Sat
<time datetime="2021-01-06">
06 Wed
</time>
</li>
</ol>
Expand Down
2 changes: 1 addition & 1 deletion components/calendar/src/vwc-calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class VWCCalendar extends LitElement {
return html`
<div class="container">
<ol class="headline">
${this.getWeekdaysByDate(new Date()).map(
${this.getWeekdaysByDate(new Date(Date.UTC(2021, 1, 1))).map(
(date) =>
html`<li>
<time datetime=${this.getValidDateString(date)}
Expand Down
4 changes: 2 additions & 2 deletions components/calendar/test/calendar.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ chai.use(chaiDomDiff);

const COMPONENT_NAME = 'vwc-calendar';

describe('Calendar', () => {
describe('calendar', () => {
let addElement = isolatedElementsCreation();

it(`${COMPONENT_NAME} is defined as a custom element`, async () => {
assert.exists(customElements.get(COMPONENT_NAME));
});

it('should internal contents', async () => {
it('should match internal contents', async () => {
const addedElements = addElement(
textToDomToParent(`<${COMPONENT_NAME}>Button Text</${COMPONENT_NAME}>`)
);
Expand Down

0 comments on commit 2c4ee98

Please sign in to comment.