Skip to content
This repository has been archived by the owner on Jan 7, 2022. It is now read-only.

Commit

Permalink
Add test for macro tokens format
Browse files Browse the repository at this point in the history
  • Loading branch information
mariomka committed Jul 8, 2018
1 parent f868eb6 commit d995e02
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions test/specs/Datetime.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,18 +395,34 @@ describe('Datetime.vue', function () {

it('should be formatted in the specified format', function () {
const vm = createVM(this,
`<Datetime v-model="datetime" :format="format" zone="UTC"></Datetime>`,
`<Datetime v-model="datetime" type="datetime" :format="format" zone="UTC+03:00"></Datetime>`,
{
components: { Datetime },
data () {
return {
datetime: '2017-12-07T19:34:54.078+03:00',
format: LuxonDateTime.DATE_HUGE
format: LuxonDateTime.DATETIME_FULL_WITH_SECONDS
}
}
})

expect(vm.$('.vdatetime-input').value).to.be.equal('Thursday, December 7, 2017')
expect(vm.$('.vdatetime-input').value).to.be.equal('December 7, 2017, 7:34:54 PM UTC')
})

it('should be formatted in the specified macro format', function () {
const vm = createVM(this,
`<Datetime v-model="datetime" :format="format" zone="UTC+03:00"></Datetime>`,
{
components: { Datetime },
data () {
return {
datetime: '2017-12-07T19:34:54.078+03:00',
format: 'yyyy-MM-dd HH:mm:ss'
}
}
})

expect(vm.$('.vdatetime-input').value).to.be.equal('2017-12-07 19:34:54')
})

it('should be updated if value is updated', function (done) {
Expand Down

0 comments on commit d995e02

Please sign in to comment.