cartodb-4.42/lib/assets/test/spec/new-dashboard/unit/specs/components/RouterLink.spec.js
2024-04-06 05:25:13 +00:00

23 lines
618 B
JavaScript

import { shallowMount } from '@vue/test-utils';
import RouterLink from 'new-dashboard/bundles/header/components/RouterLink';
jest.mock('new-dashboard/store/utils/getCARTOData', () => function () {
return {
user_data: {
base_url: 'example-baseurl.com'
}
};
});
describe('RouterLink.js', () => {
it('should a link element with the given static route as url', () => {
const routerLinkElement = shallowMount(RouterLink, {
propsData: {
staticRoute: '/test-path'
},
slots: { default: 'Test Router Link' }
});
expect(routerLinkElement).toMatchSnapshot();
});
});