Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
14 changed files
with
315 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,33 @@ | ||
import Vue from 'vue' | ||
import { describeWithMountingMethods } from '~resources/utils' | ||
import { | ||
describeWithMountingMethods, | ||
itSkipIf, | ||
isRunningPhantomJS | ||
} from '~resources/utils' | ||
|
||
describeWithMountingMethods('options.localVue', (mountingMethod) => { | ||
it('mounts component using passed localVue as base Vue', () => { | ||
const TestComponent = { | ||
template: ` | ||
itSkipIf( | ||
isRunningPhantomJS, | ||
'mounts component using passed localVue as base Vue', () => { | ||
const TestComponent = { | ||
template: ` | ||
<div>{{test}}</div> | ||
` | ||
} | ||
const localVue = Vue.extend() | ||
localVue.version = '2.3' | ||
const wrapper = mountingMethod(TestComponent, { | ||
localVue: localVue, | ||
mocks: { test: 'some value' } | ||
} | ||
const localVue = Vue.extend() | ||
localVue.version = '2.3' | ||
const wrapper = mountingMethod(TestComponent, { | ||
localVue: localVue, | ||
mocks: { test: 'some value' } | ||
}) | ||
const HTML = mountingMethod.name === 'renderToString' | ||
? wrapper | ||
: wrapper.html() | ||
expect(HTML).to.contain('some value') | ||
const freshWrapper = mountingMethod(TestComponent) | ||
const freshHTML = mountingMethod.name === 'renderToString' | ||
? freshWrapper | ||
: freshWrapper.html() | ||
expect(freshHTML).to.not.contain('some value') | ||
}) | ||
const HTML = mountingMethod.name === 'renderToString' | ||
? wrapper | ||
: wrapper.html() | ||
expect(HTML).to.contain('some value') | ||
const freshWrapper = mountingMethod(TestComponent) | ||
const freshHTML = mountingMethod.name === 'renderToString' | ||
? freshWrapper | ||
: freshWrapper.html() | ||
expect(freshHTML).to.not.contain('some value') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.