Last active
February 19, 2021 10:15
-
-
Save sidouglas/31c0b64c49c38aca6c15f6554f4f7bc8 to your computer and use it in GitHub Desktop.
Live Template for JetBrains (Velocity) for a new test case
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
#set($pascalCaseName = ${StringUtils.removeAndHump($NAME, '-')}) | |
#set($titleCaseName = ${pascalCaseName.replaceAll("([A-Z])", " $1").trim()}) | |
import { mountFunction } from 'tests/unit/mount' | |
import $pascalCaseName from '@/components/#if($folder != '')$folder/#end$pascalCaseName' | |
import { getLastEvent, getLastItemFromArray } from 'tests/helpers' | |
describe('$titleCaseName', () => { | |
beforeEach(() => { | |
}) | |
it('renders the component', () => { | |
const wrapper = mountComponent() | |
expect(wrapper.html()).toMatchSnapshot() | |
}) | |
it('should do something', async () => { | |
const wrapper = mountComponent({ propsData: {} }) | |
await wrapper.vm.${DS}nextTick() | |
}) | |
}) | |
function mountComponent ({ propsData = {} } = {}) { | |
return mountFunction($pascalCaseName, { | |
propsData: { | |
...propsData | |
}, | |
}) | |
} | |
## Do not use Reformat according to style |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment