3')
+ })
itSkipIf(mountingMethod.name === 'renderToString',
'throws error if passed string in default slot object and vue-template-compiler is undefined', () => {
@@ -130,7 +133,7 @@ describeWithMountingMethods('options.slots', (mountingMethod) => {
})
itDoNotRunIf(
- process.env.TEST_ENV === 'node',
+ process.env.TEST_ENV === 'node' || isRunningPhantomJS,
'mounts component with default slot if passed string in slot array object', () => {
const wrapper = mountingMethod(ComponentWithSlots, { slots: { default: [''] }})
if (mountingMethod.name === 'renderToString') {
@@ -141,7 +144,7 @@ describeWithMountingMethods('options.slots', (mountingMethod) => {
})
itDoNotRunIf(
- process.env.TEST_ENV === 'node',
+ process.env.TEST_ENV === 'node' || isRunningPhantomJS,
'mounts component with default slot if passed string in slot text array object', () => {
const wrapper = mountingMethod(ComponentWithSlots, { slots: { default: ['{{ foo }}1', 'bar'] }})
if (mountingMethod.name === 'renderToString') {
@@ -241,7 +244,7 @@ describeWithMountingMethods('options.slots', (mountingMethod) => {
}
})
- itDoNotRunIf(process.env.TEST_ENV === 'node',
+ itDoNotRunIf(process.env.TEST_ENV === 'node' || isRunningPhantomJS,
'mounts component with default slot if passed string in slot object', () => {
const TestComponent = {
name: 'component-with-slots',
@@ -257,7 +260,7 @@ describeWithMountingMethods('options.slots', (mountingMethod) => {
})
itDoNotRunIf(
- process.env.TEST_ENV === 'node',
+ process.env.TEST_ENV === 'node' || isRunningPhantomJS,
'mounts component with named slot if passed string in slot object', () => {
const TestComponent = {
functional: true,
@@ -272,7 +275,7 @@ describeWithMountingMethods('options.slots', (mountingMethod) => {
})
itDoNotRunIf(
- process.env.TEST_ENV === 'node',
+ process.env.TEST_ENV === 'node' || isRunningPhantomJS,
'mounts component with named slot if passed string in slot object in array', () => {
const TestComponent = {
functional: true,
@@ -287,7 +290,7 @@ describeWithMountingMethods('options.slots', (mountingMethod) => {
})
itDoNotRunIf(
- process.env.TEST_ENV === 'node',
+ process.env.TEST_ENV === 'node' || isRunningPhantomJS,
'mounts component with named slot if passed string in slot object in array', () => {
const TestComponent = {
functional: true,
@@ -302,7 +305,7 @@ describeWithMountingMethods('options.slots', (mountingMethod) => {
})
itDoNotRunIf(
- process.env.TEST_ENV === 'node',
+ process.env.TEST_ENV === 'node' || isRunningPhantomJS,
'mounts component with named slot if passed string in slot object in array', () => {
const TestComponent = {
functional: true,
@@ -382,8 +385,9 @@ describeWithMountingMethods('options.slots', (mountingMethod) => {
require.cache[require.resolve('vue-template-compiler')].exports.compileToFunctions = compilerSave
})
- itDoNotRunIf(mountingMethod.name === 'renderToString',
- 'afd', () => {
+ itDoNotRunIf(
+ mountingMethod.name === 'renderToString' || isRunningPhantomJS,
+ 'does not error when triggering a click in a slot', () => {
const Parent = {
name: 'Parent',
template: `
diff --git a/test/specs/wrapper/contains.spec.js b/test/specs/wrapper/contains.spec.js
index d76574616..9d292e1be 100644
--- a/test/specs/wrapper/contains.spec.js
+++ b/test/specs/wrapper/contains.spec.js
@@ -5,7 +5,9 @@ import FunctionalComponent from '~resources/components/functional-component.vue'
import ComponentAsAClass from '~resources/components/component-as-a-class.vue'
import {
functionalSFCsSupported,
- describeWithShallowAndMount
+ describeWithShallowAndMount,
+ isRunningPhantomJS,
+ itSkipIf
} from '~resources/utils'
import ComponentWithoutName from '~resources/components/component-without-name.vue'
@@ -40,20 +42,22 @@ describeWithShallowAndMount('contains', (mountingMethod) => {
expect(wrapper.contains(FunctionalComponent)).to.equal(true)
})
- it('returns true if wrapper contains Vue class component', () => {
- const TestComponent = {
- template: `
+ itSkipIf(
+ isRunningPhantomJS,
+ 'returns true if wrapper contains Vue class component', () => {
+ const TestComponent = {
+ template: `
`,
- components: {
- ComponentAsAClass
+ components: {
+ ComponentAsAClass
+ }
}
- }
- const wrapper = mountingMethod(TestComponent)
- expect(wrapper.contains(ComponentAsAClass)).to.equal(true)
- })
+ const wrapper = mountingMethod(TestComponent)
+ expect(wrapper.contains(ComponentAsAClass)).to.equal(true)
+ })
it('returns true if wrapper contains element specified by ref selector', () => {
const compiled = compileToFunctions('')
diff --git a/test/specs/wrapper/find.spec.js b/test/specs/wrapper/find.spec.js
index 891596366..c4685d58e 100644
--- a/test/specs/wrapper/find.spec.js
+++ b/test/specs/wrapper/find.spec.js
@@ -10,7 +10,10 @@ import ComponentAsAClass from '~resources/components/component-as-a-class.vue'
import {
functionalSFCsSupported,
vueVersion,
- describeWithShallowAndMount
+ describeWithShallowAndMount,
+ isRunningPhantomJS,
+ itDoNotRunIf,
+ itSkipIf
} from '~resources/utils'
describeWithShallowAndMount('find', (mountingMethod) => {
@@ -32,14 +35,16 @@ describeWithShallowAndMount('find', (mountingMethod) => {
expect(wrapper.find('div').vnode).to.be.an('object')
})
- it('returns an array of Wrapper of elements matching class selector passed if they are declared inside a slot', () => {
- const wrapper = mountingMethod(ComponentWithSlots, {
- slots: {
- default: ''
- }
+ itDoNotRunIf(
+ isRunningPhantomJS,
+ 'returns an array of Wrapper of elements matching class selector passed if they are declared inside a slot', () => {
+ const wrapper = mountingMethod(ComponentWithSlots, {
+ slots: {
+ default: ''
+ }
+ })
+ expect(wrapper.find('.foo').vnode).to.be.an('object')
})
- expect(wrapper.find('.foo').vnode).to.be.an('object')
- })
it('returns Wrapper matching class selector passed if they are declared inside a functional component', () => {
const Component = {
@@ -108,21 +113,23 @@ describeWithShallowAndMount('find', (mountingMethod) => {
expect(wrapper.find(Component).vnode).to.be.an('object')
})
- it('returns Wrapper of class component', () => {
- const TestComponent = {
- template: `
+ itSkipIf(
+ isRunningPhantomJS,
+ 'returns Wrapper of class component', () => {
+ const TestComponent = {
+ template: `
`,
- components: {
- ComponentAsAClass
+ components: {
+ ComponentAsAClass
+ }
}
- }
- const wrapper = mountingMethod(TestComponent)
- expect(wrapper.find(ComponentAsAClass).vnode).to.be.an('object')
- })
+ const wrapper = mountingMethod(TestComponent)
+ expect(wrapper.find(ComponentAsAClass).vnode).to.be.an('object')
+ })
it('returns Wrapper of Vue Component matching functional component', () => {
if (!functionalSFCsSupported()) {
diff --git a/test/specs/wrapper/findAll.spec.js b/test/specs/wrapper/findAll.spec.js
index 9b452740b..78584cdc4 100644
--- a/test/specs/wrapper/findAll.spec.js
+++ b/test/specs/wrapper/findAll.spec.js
@@ -8,7 +8,10 @@ import FunctionalComponent from '~resources/components/functional-component.vue'
import ComponentAsAClass from '~resources/components/component-as-a-class.vue'
import {
functionalSFCsSupported,
- describeWithShallowAndMount
+ describeWithShallowAndMount,
+ itDoNotRunIf,
+ itSkipIf,
+ isRunningPhantomJS
} from '~resources/utils'
describeWithShallowAndMount('findAll', (mountingMethod) => {
@@ -33,15 +36,17 @@ describeWithShallowAndMount('findAll', (mountingMethod) => {
expect(divArr.length).to.equal(1)
})
- it('returns an array of Wrapper of elements matching class selector passed if they are declared inside a slot', () => {
- const wrapper = mountingMethod(ComponentWithSlots, {
- slots: {
- default: '
'
- }
+ itDoNotRunIf(
+ isRunningPhantomJS,
+ 'returns an array of Wrapper of elements matching class selector passed if they are declared inside a slot', () => {
+ const wrapper = mountingMethod(ComponentWithSlots, {
+ slots: {
+ default: '
'
+ }
+ })
+ const fooArr = wrapper.findAll('.foo')
+ expect(fooArr.length).to.equal(2)
})
- const fooArr = wrapper.findAll('.foo')
- expect(fooArr.length).to.equal(2)
- })
it('returns an array of Wrapper of elements matching class selector passed if they are declared inside a functional component', () => {
const Component = {
@@ -194,21 +199,23 @@ describeWithShallowAndMount('findAll', (mountingMethod) => {
expect(wrapper.findAll(ComponentWithoutName).length).to.equal(3)
})
- it('returns Wrapper of class component', () => {
- const TestComponent = {
- template: `
+ itSkipIf(
+ isRunningPhantomJS,
+ 'returns Wrapper of class component', () => {
+ const TestComponent = {
+ template: `