Skip to content

Commit

Permalink
chore: save test commit
Browse files Browse the repository at this point in the history
  • Loading branch information
johnleider committed Feb 17, 2023
1 parent af6a215 commit 57042b5
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
36 changes: 36 additions & 0 deletions packages/vuetify/src/adapters/date-fns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,40 @@ export default class DateFnsAdapter implements DateAdapter<Date> {
getWeek (date: Date) {
return getWeek(date)
}

addDays (date: Date, amount: number) {
return null
}

date () {
return null
}

format (date: Date, formatString: string) {
return null
}

getMonth (date: Date) {
return null
}

getWeekArray (month: Date) {
return null
}

getYear (date: Date) {
return null
}

isSameDay (date: Date, comparing: Date) {
return null
}

isSameMonth (date: Date, comparing: Date) {
return null
}

isWithinRange (date: Date, range: [Date, Date]) {
return null
}
}
45 changes: 45 additions & 0 deletions packages/vuetify/src/composables/__tests__/date.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Composables
import { createDate, makeDateProps, useDate } from '../date'
import { createVuetify } from '@/framework'

// Utilities
import { mount } from '@vue/test-utils'
import { describe, expect, it } from '@jest/globals'

// Types
import DateFnsAdapter from '@/adapters/date-fns'
import { defineComponent, h } from 'vue'

describe('date.ts', () => {
const Component = defineComponent({
props: makeDateProps(),

setup (props) {
const date = useDate(props)

return { date }
},

render () {
return h('div', this.$slots.default?.(this.date))
},
})

const vuetify = createVuetify({
date: {
adapter: DateFnsAdapter,
},
})

it('should have the correct days in a month', () => {
const wrapper = mount(Component, {
global: {
plugins: [vuetify],
},
})

console.log(wrapper.vm.date)

expect(wrapper).toBeTruthy()
})
})

0 comments on commit 57042b5

Please sign in to comment.