Commit 97395426 authored by Savas Vedova's avatar Savas Vedova Committed by Ezekiel Kigbo

Mock timeago to prevent failing snapshots

parent 791c2f62
......@@ -90,7 +90,7 @@ exports[`NetworkPolicyList component renders policies table 1`] = `
>
<div>
4 months ago
2 weeks ago
</div>
</td>
......
import { mount } from '@vue/test-utils';
import { GlTable } from '@gitlab/ui';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import createStore from 'ee/threat_monitoring/store';
import NetworkPolicyList from 'ee/threat_monitoring/components/network_policy_list.vue';
import { GlTable } from '@gitlab/ui';
import { PREDEFINED_NETWORK_POLICIES } from 'ee/threat_monitoring/constants';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import { mockPoliciesResponse } from '../mock_data';
jest.mock('timeago.js', () => ({
format: jest.fn().mockReturnValue('2 weeks ago'),
register: jest.fn(),
}));
const mockData = mockPoliciesResponse.map(policy => convertObjectPropsToCamelCase(policy));
describe('NetworkPolicyList component', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment