import Login from "../Login.vue";
import {mount} from "@vue/test-utils";
import { shallowMount } from '@vue/test-utils'
import Service from "../service/Service";
import Contenu from "../Contenu";
import Volet_Base from "../components/Volet_Base";
import Volet_Menu from "../components/Volet_Menu";
import Modifier_Contenu from "../components/Modifier_Contenu";

// Rien a tester dans Index.vue, car c'est juste un "aggrégateur" pour d'autres composants.

test('Modifier_Contenu', () => {

    const wrapper = shallowMount(Modifier_Contenu)

    wrapper.vm.action = jest.fn()

    let button = wrapper.find('#validerModif');
    button.trigger('click');

    expect(wrapper.vm.action).toHaveBeenCalled()

    button = wrapper.find('#retourArriere');
    button.trigger('click');

    expect(wrapper.vm.action).toHaveBeenCalledTimes(2)

})