{"version":3,"sources":["webpack:///./src/demo/snippets/js/testing_mock_component_spec.txt"],"names":[],"mappings":"kHAAA,OAAe","file":"js/chunk-2d0c918b.8ab22689.js","sourcesContent":["export default \"// test/CustomCard.spec.js\\n\\n// Libraries\\nimport Vue from 'vue'\\nimport Vuetify from 'vuetify'\\n\\n// Components\\nimport CustomCard from '@/components/CustomCard'\\n\\n// Utilities\\nimport {\\n mount,\\n createLocalVue\\n} from '@vue/test-utils'\\n\\nconst localVue = createLocalVue()\\n\\ndescribe('CustomCard.vue', () => {\\n let vuetify\\n\\n beforeEach(() => {\\n vuetify = new Vuetify()\\n })\\n\\n it('should have a custom title and match snapshot', () => {\\n const wrapper = mount(CustomCard, {\\n localVue,\\n vuetify,\\n propsData: {\\n title: 'Foobar',\\n },\\n })\\n\\n // With jest we can create snapshot files of the HTML output\\n expect(wrapper.html()).toMatchSnapshot()\\n\\n // We could also verify this differently\\n // by checking the text content\\n const title = wrapper.find('.v-card__title > span')\\n\\n expect(title.text()).toBe('Foobar')\\n })\\n\\n it('should emit an event when the action v-btn is clicked', () => {\\n const wrapper = mount(CustomCard, {\\n localVue,\\n vuetify,\\n propsData: {\\n title: 'Foobar',\\n },\\n })\\n\\n const event = jest.fn()\\n const button = wrapper.find('.v-btn')\\n\\n // Here we bind a listener to the wrapper\\n // instance to catch our custom event\\n // https://vuejs.org/v2/api/#Instance-Methods-Events\\n wrapper.vm.$on('action-btn:clicked', event)\\n\\n expect(event).toHaveBeenCalledTimes(0)\\n\\n // Simulate a click on the button\\n button.trigger('click')\\n\\n // Ensure that our mock event was called\\n expect(event).toHaveBeenCalledTimes(1)\\n })\\n})\\n\";"],"sourceRoot":""}