I am doing some tests and I want to check if a method is called after I trigger a click in an element, but the test keeps saying that is wasn't called and I don't know why
Here is my test:
test('some test', () => {
const somethingChanged= jest.spyOn(Component.methods, 'somethingChanged')
const wrapper = mount(Component, {
propsData: data
})
const element= wrapper.find('.c-element').trigger('click')
expect(somethingChanged).toBeCalled()
})
This keeps saying that the number of calls is 0 and I don't know what I'm doing wrong This method is triggered in the component so I know it works