storj/web/satellite/tests/unit/ignore/common/VHeader.spec.ts
Vitalii ace0ef89a2 web/satellite: migrated Vue 2 to Vue 3
Finally migrated web/satellite UI to use Vue 3.

Issue:
https://github.com/storj/storj/issues/5862

Change-Id: I609e2332142b9092d6efeb2d4b931e34cce846cc
2023-05-17 17:31:03 +00:00

32 lines
873 B
TypeScript

// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
import { mount, shallowMount } from '@vue/test-utils';
import HeaderComponent from '@/components/common/VHeader.vue';
describe('HeaderComponent.vue', () => {
it('renders correctly', () => {
const wrapper = shallowMount(HeaderComponent);
expect(wrapper).toMatchSnapshot();
});
it('renders correctly with default props', () => {
const wrapper = mount(HeaderComponent);
expect(wrapper.vm.$props.placeholder).toMatch('');
});
it('function clearSearch works correctly', () => {
const search = jest.fn();
const wrapper = mount(HeaderComponent, {
propsData: {
search: search,
},
});
wrapper.vm.clearSearch();
expect(search).toHaveBeenCalledTimes(1);
});
});