Commit d7dd2d72 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Merge branch 'fix-network-policy-date-in-specs' into 'master'

Mock timeago to prevent failing snapshots

See merge request gitlab-org/gitlab!39815
parents aa3e991d 46b458d2
...@@ -90,7 +90,7 @@ exports[`NetworkPolicyList component renders policies table 1`] = ` ...@@ -90,7 +90,7 @@ exports[`NetworkPolicyList component renders policies table 1`] = `
> >
<div> <div>
4 months ago 2 weeks ago
</div> </div>
</td> </td>
......
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import { GlTable } from '@gitlab/ui';
import createStore from 'ee/threat_monitoring/store'; import createStore from 'ee/threat_monitoring/store';
import NetworkPolicyList from 'ee/threat_monitoring/components/network_policy_list.vue'; 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 { PREDEFINED_NETWORK_POLICIES } from 'ee/threat_monitoring/constants';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils'; import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import { mockPoliciesResponse } from '../mock_data'; 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)); const mockData = mockPoliciesResponse.map(policy => convertObjectPropsToCamelCase(policy));
describe('NetworkPolicyList component', () => { 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