mardi 3 avril 2018

How to test router-link in vue.js test ?

import { shallow } from '@vue/test-utils'; import EmplyoeesTab from '../../../../resources/assets/js/components/front/about/EmplyoeesTab.vue';

describe('EmplyoeesTab',()=>{ let wrapper;

beforeEach(()=>{
    wrapper = shallow(EmplyoeesTab,{
        methods: {
            trans (key) {
                return key
            }
        },
    })
});

it ('shows title', () => {
    see(wrapper,'about.Employees_Finans');
});
it ('shows Client support Tab', () => {
    see(wrapper,'about.Client_support');
});
it ('shows IT Tab', () => {
    see(wrapper,'about.IT');
});
it ('shows Finance and marketing Tab', () => {
    see(wrapper,'about.Finance_and_marketing');
});
it ('shows Management Tab', () => {
    see(wrapper,'about.Management');
});

it ('click "On Employees at Frilans Finans Tab"', () => {
  const tab = wrapper.find('button.tab-btn');
  tab.trigger('click');
  see(wrapper,'about.The_administration_also_called');
  see(wrapper,'about.The_IT_department');
  expect(wrapper.find('p.tab-3-content').exists()).toBe(true);

});

});



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2H4HIZu
via IFTTT

Aucun commentaire:

Enregistrer un commentaire