Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
borosr committed Jul 5, 2024
1 parent 8a18ac7 commit a4bbb19
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions src/fp-money/component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, it, expect } from 'vitest'
import { mount } from '@vue/test-utils'
import Comp from './component.vue'
import { nextTick } from 'vue'
import {Values} from "./fp-money";

describe('Component', () => {
it('Mounts properly', () => {
Expand All @@ -16,21 +16,20 @@ describe('Component', () => {
})

it('Make sure defaults are set', async () => {
const props = {
modelValue: 0,

}
const wrapper = mount(Comp, { props: {
modelValue: 0,
} })
await nextTick()

const data = JSON.parse(JSON.stringify(wrapper.vm))
const wrapper = mount(Comp, {
props: {
modelValue: 0,
onChange: (data: Values) => {
expect(data.currency).toBe('USD')
expect(data.locale).toBe('en-US')
}
}
})

const data = JSON.parse(JSON.stringify(wrapper.getCurrentComponent().props))

expect(data.modelValue).toBe(0)
expect(data.valueFormat).toBe('float')
expect(data.currency).toBe('USD')
expect(data.locale).toBe('')
})

// it('Set initial value and update with new value', async () => {
Expand Down

0 comments on commit a4bbb19

Please sign in to comment.