Skip to content

Commit 2f4cdb8

Browse files
authored
test: unskip tests: (#697)
1 parent 0590b4c commit 2f4cdb8

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

packages/test-utils/src/wrapper.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -580,13 +580,9 @@ export default class Wrapper implements BaseWrapper {
580580
/**
581581
* Checks radio button or checkbox element
582582
*/
583-
setChecked (checked: boolean) {
584-
if (typeof checked !== 'undefined') {
585-
if (typeof checked !== 'boolean') {
586-
throwError('wrapper.setChecked() must be passed a boolean')
587-
}
588-
} else {
589-
checked = true
583+
setChecked (checked: boolean = true) {
584+
if (typeof checked !== 'boolean') {
585+
throwError('wrapper.setChecked() must be passed a boolean')
590586
}
591587

592588
const el = this.element
@@ -604,6 +600,10 @@ export default class Wrapper implements BaseWrapper {
604600
} else if (tag === 'INPUT' && type === 'checkbox') {
605601
// $FlowIgnore
606602
if (el.checked !== checked) {
603+
if (!navigator.userAgent.includes('jsdom')) {
604+
// $FlowIgnore
605+
el.checked = checked
606+
}
607607
this.trigger('click')
608608
this.trigger(event)
609609
}

test/specs/wrapper/setChecked.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import ComponentWithInput from '~resources/components/component-with-input.vue'
22
import { describeWithShallowAndMount } from '~resources/utils'
33

44
describeWithShallowAndMount('setChecked', (mountingMethod) => {
5-
it.skip('sets element checked true with no option passed', () => {
5+
it('sets element checked true with no option passed', () => {
66
const wrapper = mountingMethod(ComponentWithInput)
77
const input = wrapper.find('input[type="checkbox"]')
88
input.setChecked()
99

1010
expect(input.element.checked).to.equal(true)
1111
})
1212

13-
it.skip('sets element checked equal to param passed', () => {
13+
it('sets element checked equal to param passed', () => {
1414
const wrapper = mountingMethod(ComponentWithInput)
1515
const input = wrapper.find('input[type="checkbox"]')
1616

@@ -21,7 +21,7 @@ describeWithShallowAndMount('setChecked', (mountingMethod) => {
2121
expect(input.element.checked).to.equal(false)
2222
})
2323

24-
it.skip('updates dom with checkbox v-model', () => {
24+
it('updates dom with checkbox v-model', () => {
2525
const wrapper = mountingMethod(ComponentWithInput)
2626
const input = wrapper.find('input[type="checkbox"]')
2727

@@ -32,7 +32,7 @@ describeWithShallowAndMount('setChecked', (mountingMethod) => {
3232
expect(wrapper.text()).to.not.contain('checkbox checked')
3333
})
3434

35-
it.skip('changes state the right amount of times with checkbox v-model', () => {
35+
it('changes state the right amount of times with checkbox v-model', () => {
3636
const wrapper = mountingMethod(ComponentWithInput)
3737
const input = wrapper.find('input[type="checkbox"]')
3838

test/specs/wrapper/setValue.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import ComponentWithInput from '~resources/components/component-with-input.vue'
22
import { describeWithShallowAndMount } from '~resources/utils'
33

44
describeWithShallowAndMount('setValue', (mountingMethod) => {
5-
it.skip('sets element value', () => {
5+
it('sets element value', () => {
66
const wrapper = mountingMethod(ComponentWithInput)
77
const input = wrapper.find('input[type="text"]')
88
input.setValue('foo')
99

1010
expect(input.element.value).to.equal('foo')
1111
})
1212

13-
it.skip('updates dom with v-model', () => {
13+
it('updates dom with v-model', () => {
1414
const wrapper = mountingMethod(ComponentWithInput)
1515
const input = wrapper.find('input[type="text"]')
1616

0 commit comments

Comments
 (0)