jsonbaby92

Untitled

Jun 17th, 2021 (edited)
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import vue2Dropzone from 'vue2-dropzone';
  2. import { mount } from '@vue/test-utils';
  3.  
  4. describe('DropZone test suite', () => {
  5.   it('dropzone emits drag events', () => {
  6.     const wrapper = mount(vue2Dropzone, {
  7.       propsData: {
  8.         id: 'dropzone',
  9.         options: {
  10.           url: '/',
  11.           maxFiles: 1,
  12.           addRemoveLinks: true,
  13.           autoProcessQueue: false,
  14.         },
  15.       },
  16.     });
  17.  
  18.     wrapper.trigger('dragenter', {
  19.       file: 1,
  20.     });
  21.  
  22.     expect(wrapper.emitted('vdropzone-drag-enter')[0]).toEqual(
  23.       expect.arrayContaining([expect.objectContaining({ file: 1 })]),
  24.     );
  25.   });
  26. });
  27.  
Add Comment
Please, Sign In to add comment